dear developers
i successfully add arduino uno to cayenne…1st task is over
now, when i am uploading any sketch to arduino ide (the sketches getting after we add any actuator or sensor to cayenne), i am getting error i.e
avrdude: ser_open(): can’t open device “\.\COM3”: Access is denied.
i find many help in cayenne community.all types of necessary changes were made by my side like
1)i remove serial.begin from sketch…nothing happened
2) i go to the script folder and find cayenne-ser file.and then open with ms word and changed COMM_PORT_OSX=/dev/tty.usbmodem to COMM_PORT_OSX=/dev/tty.usbmodem1234…nothing happened
3 some says …need to stop cayenne server…but after executed, devices get offline…and the sketch is uploading without any error…but one problem i get persists i.e… devices gets into offline mode. so i again tried to start cayenne server by executing command “cayenne-ser.bat -c COM3”.but devices not get connected…only waiting for connection.
I have basically 0 MacOS experience, but sounds like your user account either doesn’t have access to do what you’re trying to do, or COM3 is not the correct port. Maybe someone else that know more about MacOS will have some better suggestions.
first of all when you are uploading sketch to arduino make use the cmd is closed
restore your settings dont do anything with the script folder
then check the port in which u as plug in from the arduino idle and change cayenne-ser.bat -c COM** and replace the xx with the port you have plug in and hit go it will do let me know if it works
Hello, I have the same issue. But I cannot resolve it with your description. My Arduino Uno is connected to Cayenne Dashboard after running the script. (My system is Windows 8). After I close the cmd (arduino goes offline) I can upload the luminosity sketch but after that my arduino is remained offline and I cannot make it online. I tried to reopen cmd and run the same bat file: cayenne-ser.bat -c COM3 (port is correct) but without success:
.
And this message is continously repeating after every 5 sec…
What does “restore your settings” mean exactly?
Any idea please? How should I connect my Arduino again without starting the full story again from the beginning?
Thanks in advance
qw.txt (3.0 KB)
insert the authentication code in the sketch and upload
after that
open cmd
cd C:\Users[YourUserName]\Documents\Arduino\libraries\Cayenne\extras\scripts
press enter
then insert the code cayenne-ser.bat -c COMxx where xx is your port number
and hit enter
make sure there is no serial activities going in pc
and your internet connection is strong enough and you have the cayenne library
check whether you have given the right serial port the port which is been used can be obtained from the arduino idle
First, I would like to thank you for your kind reply. I checked your code and found that this line was not in yours: #define CAYENNE_PRINT Serial
I removed that line from my sketch (as you also draw my attention with this: "make sure there is no serial activities going in pc ") and after upload it seems I managed to run the script correctly and Arduino went online. Could it be the issue? What do you think?
Anyway, here you can find my sketch:
/*
Cayenne Luminosity Example
This sketch sample file shows how to change the brightness on a LED
using Cayenne Dashboard.
The Cayenne Library is required to run this sketch. If you have not already done so you can install it from the Arduino IDE Library Manager.
Steps:
In the Cayenne Dashboard add a new Custom Widget, and select Slider.
Select a virtual pin number.
Set min value to 0 and max value of 1.
Set LED_VIRTUAL_PIN to the pin number you selected.
Connect the LED’s legs to GND, and to a PWM pin (3, 5, 6, 9, 10, and 11 on most Arduino boards).
Use a 1k resistor if possible.
Schematic:
[Ground] – [LED] – [1k-resistor] – [PWM Pin]
Set LED_DIGITAL_PIN to the PWM pin number you selected.
Set the token variable to match the Arduino token from the Dashboard.
Compile and upload this sketch.
Once the Arduino connects to the Dashboard you can use the slider to change LED brightness.
*/
//#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space
// If you’re not using the Ethernet W5100 shield, change this to match your connection type. See Communications examples. #include < CayenneSerial.h>
CAYENNE_IN(LED_VIRTUAL_PIN)
{
// get value sent from dashboard
int currentValue = getValue.asInt(); // 0 to 1023
analogWrite(LED_DIGITAL_PIN, currentValue / 4); // must be from 0 to 255
}