Hello,
I want to connect my Arduino UNO to Cayenne via USB but it doesn’t connect and in serial monitor appears my token . I’m using linux with chrome.
If somebody can help me , please write here.
Regards,
your Cayenne user
Hi @matei.tudose2005, welcome to the Cayenne Community. I’d be happy to help.
With the USB serial connection sketch, there is a script file that needs to be running per the commented section at the top of the sketch. Can you confirm that it’s running OK? I know on my Mac I had to run chmod +x cayenne-ser.sh
to make it executable which wasn’t in that documentation.
No , it doesn’t worked . It said : chmod: cannot access ‘cayenne-ser.sh’: No such file or directory
Oh, sorry, first you need to find the directory where the script lives on Linux. I believe this is:
/usr/share/arduino/libraries/Cayenne/extras/scripts
but if I’m wrong I can fire up a Linux machine to check for sure. Once you’re in that directory, try running the command I gave above, then
./cayenne-ser.sh
Ok , i found it but what i must do? I don’t understand
No worries. The USB Serial connection is probably the trickiest compared to Ethernet/WiFi, there are a lot of little gotchas. In my experience it works great though once you have it running.
Here is what I would do:
-
Open the Arduino IDE and connect your UNO via USB. Make sure that the Board and Port settings in the Tools menu are both set to ‘Genuino/Uno’ (generally the IDE does this automatically).
-
Open the SerialUSBConnection sketch in the Arduino IDE from File>Examples>Cayenne>InternetConnections
-
In the Cayenne web Dashboard, add a new Arduino device and proceed to the Step 3 page. Copy and paste the token into your SerialUSBConnection sketch in the IDE.
-
Compile and upload the sketch your your UNO
-
On your Linux machine, cd to /usr/share/arduino/libraries/Cayenne/extras/scripts
-
enter ./cayenne-ser.sh
to run the serial communication script.
If things are working ok, you should see output similar to this:
and of course the board will show as online in the Cayenne Dashboard.
If you run into an error, just paste or screenshot the output for me and I’m sure I can help you work through it. Once you have this working once it tends to be pretty easy to re-use over and over again.
2 Likes
Thanks a lot !!! I did it !
2 Likes
Awesome, glad to hear it. Have any exciting plans for your Arduino?