When you write a sketch in the Arduino IDE and you want to upload it to one of the CANZERO nodes in your NoCAN IoT network, you typically go through these steps:
- Navigate to Export compiled binary in the Sketch menu of the Arduino IDE.
- Use the web interface or the command line to upload the resulting binary to the target CANZERO node.
This is not very hard, but it's still not as easy as programming a classic Arduino UNO where you just click on the "Upload" icon after configuring the correct "Port" in the IDE.
Well, thanks to a recently added feature in the Arduino IDE 1.8.9 you can now do the same "Click to upload" for the NoCAN platform!
Configuring the Arduino IDE for NoCAN
You will need to install the latest Arduino IDE (version 1.8.9 or above).
Get the latest version of the Omzlo NoCAN boards (version 0.3.0) in the Arduino IDE:
- Make sure you have correctly configured Arduino as indicated in our tutorial
- Navigate to the board manager: Tools > Board > Board Manager. Then select Omzlo SAMD boards, version 0.3.0, and click install/update.
- Restart the Arduino IDE.
If you have a Windows machine, edit or create the file named _nocanc.conf
that will be placed in your user directory,e.g.:
Notepad.exe %userprofile%\_nocanc.conf
On a Linux or MacOS machine, edit or create the file named .nocanc.conf
in your home directory, e.g.:
nano ~\.nocanc.conf
This file should have content similar to the following example:
event-server = "192.168.2.112:4242" auth-token = "yoursupersecretpassword"
Of course, you need to replace 192.168.2.112
with the address of your Raspberry Pi running the nocand
server. You will also need to replace yoursupersecretpassword
with the password you configured for nocand
(see the tutorial for more info).
After these steps, restart the Arduino IDE and navigate to Tools > Port. A subsection of the menu should show all the connected NoCAN nodes under the title "NoCAN nodes".
Congratulations, you can now upload your sketches directly from the Arduino IDE! Cool right!
If it doesn't work double check your configuration files and make sure the nocand
server is running on your Raspberry Pi.
What next?
Uploading from the Arduino IDE was made possible by the introduction of a "Discovery" feature in the Arduino IDE 1.8.9. This feature is however still a bit buggy and will likely evolve in the next releases of the Arduino IDE. If you find bugs or have issues with this new feature, come and discuss them in our forums.
To stay updated on the NoCAN project, don't forget to follow us on Twitter or on our Facebook page.
Comments
1 comment triggered our SPAM filter and will be reviewed before publication.
Leave a comment