Connecting Arduino UNO with Cayenne


#1

Hi

I have Arduino UNO. Do I need any extra wifi/ethernet shield to connect this with Cayenne…?


Cannot execute connection script for Uno on Mac
#2

Hi @kamuthi and welcome to the Cayenne Community!

For this model of Arduino, you don’t necessarily have to have an Ethernet or WiFi shield to connect it. If you go to Add New > Device / Widget > Microcontrollers, you’ll see that we have a ‘Serial USB Connection’ sketch listed for the Arduino UNO, that will allow it to Communicate with Cayenne over a USB connection to a computer that has an internet connection.


#3

Hello

Successfully downloaded the sketch into arduino. But not able to connect with board. No error messages. Just its shows … Waiting for board to connect…

I am using Mac. In Arduino Port shows something different like “dev/cu/usbmodem14219(Arduino Uno)”

No issue in connecting with Arduino software and download.


#4

Hi @kamuthi

Setting up that USB Serial connection script can be a little tricky – after uploading the provided sketch on you arduino, you need to locate the cayenne-ser.sh file in the /Users/<youruser>/Documents/Arduino/libraries/Cayenne/extras/scripts folder.

Once located, open it in a text editor and change the line:

COMM_PORT_OSX=/dev/tty.usbmodem
so that it reflects the port shown by the Arduino IDE. For example, in my case I changed it to:
COMM_PORT_OSX=/dev/tty.usbmodem1411

after making that change, save the file, then run it with:

sudo ./cayenne-ser.sh

Once that script is running, you should see output similar to:

Connecting: GOPEN:/dev/tty.usbmodem1411,raw,echo=0,clocal=1,cs8,nonblock=1,ixoff=0,ixon=0,ispeed=9600,ospeed=9600,crtscts=0 <-> TCP:arduino.mydevices.com:8442,nodelay 2016/11/28 13:51:47 socat[52833] N opening character device "/dev/tty.usbmodem1411" for reading and writing 2016/11/28 13:51:47 socat[52833] N opening connection to LEN=16 AF=2 54.86.250.218:8442 2016/11/28 13:51:47 socat[52833] N successfully connected from local address LEN=16 AF=2 192.168.0.3:52254 2016/11/28 13:51:47 socat[52833] N starting data transfer loop with FDs [5,5] and [8,8] 2016/11/28 13:51:47 socat[52833] N socket 2 (fd 8) is at EOF 2016/11/28 13:51:48 socat[52833] N exiting with status 0

looping over and over. The Arduino should then show as online on your Cayenne dashboard (you may need to refresh the browser or re-login if its been sitting on ‘waiting for board to connect’ for many minutes already.

If you get some other output from running that script that doesn’t show the successful connection, please share with me your output and I’ll continue to help troubleshoot!


#5

Hello

Thanks for your guidance. First point done. Located that file and included Port no.

Second point:
//after making that change, save the file, then run it with:

sudo ./cayenne-ser.sh//

You mean open the Utilities & Run this Command via Link APP…?
Done this and results “Command not found.”

Not able to connect. Plz advice.


#6

Hi again.

It looks like this is because the cayenne-ser.sh file is not set to be executable on your machine. I think this needs to be added to the instructions – I forgot that I did this on my machine some time ago. Try this command while in the folder containing cayenne-ser.sh:

chmod +x cayenne-ser.sh

then, you can run the script with

sudo ./cayenne-ser.sh (notice no trailing slashes)


#7

Good Day,

I am very new to all this and have a question related to the serial usb connection on the uno as well. If i make the connection to the uno via usb it is fine, but when i try to connect a sensor i have an issue. I don’t have a w5100 ethernet shield and as such i think my connection type is wrong. What do i need to change it to in order to make it work for the usb connection?

Thanks

Kevin


#8

What exactly doesn’t work? Are you getting any errors in the serial output?