Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Uploading to Raspberry Pi (Read 2411 times)
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Uploading to Raspberry Pi
Mar 21st, 2018 at 4:48am
Print Post  
Hi,
I've been using VM for close to 5 years now and very pleased with it.  All work so far has been on a Uno-compatible board with an RFM69 radio module running ChibiOS and fully Arduino-compatible.  No problems whenever I check it all still builds with the Arduino IDE. Impressive.   

I now need to add some functionality that requires more RAM and a WiFi capability in addition to the existing radio.  I was thinking of an ESP32 for the multitudinous small nodes.  However, I also have need for a central server unit that can do more PC-like stuff, and the Raspberry Pi looks ideal for that, and may be acceptable to replace the 328P also which would simplify the logistics, even be cheaper.

So I am starting to port over my code to the Pi.   I installed a package called RasPiArduino fron github to keep it Arduino-compatible.  This package installs a new board into the Arduino IDE and appears to use SSH to upload it to the Pi - though Telnet is also involved somehow.  I tested it with Blink and Serial and it works very well, in the Arduino IDE. However, I cannot get the upload to work in VM; it gives me the following:

Uploading 'Blink' to 'RaspberryPI B+/2' using '192.168.1.30'
Uploader started for board RaspberryPI B+/2
Upload method will be: bootloader
Uploading via Bootloader 
echo "Upload" C:\Users\Jed\AppData\Local\Temp\VMBuilds\Blink\RASPBE~1\Release/BLINKI~1.HEX
The system cannot find the file specified

In contrast, the Arduino IDE outputs the following:

/usr/bin/run-avrdude /tmp/sketch.hex
Sketch Started

Now, I've figured out that the Arduino IDE is remotely invoking the /usr/bin/run-avrdude script which actually just executes the uploaded sketch hex file (and generates the "Sketch Started" message). I have also figured out that "echo upload" stuff must be how the hex file transfer is supposed to get done (it's in the platform.txt in the tools section), and that the file not found is not the hex file, but that's as far as my knowledge takes me.

So my question is why it works fine in the Arduino IDE, but not with VS/VM?  Is there a piece of VM magic I need?  I'd really like to get it working, as there is no way I can continue without a real IDE.

Supplementary question:  a video tutorial on the RasPiArduino package suggests using the Arduino IDE "Export compiled Binary" command with a network share to hold the sketch and as an easy way to get the executable to the Pi.  I don't see that in VM:  did I miss it?

Thanks for your time.
Jed
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to Raspberry Pi
Reply #1 - Mar 21st, 2018 at 12:18pm
Print Post  
Hi,

The SSH upload was initially introduced for the Arduino Yun.

I haven't tried the Pi and didn't know there was an arduino variation.

Maybe they have SSH upload command so that work will need to be done in visual micro

Please state where to install the pi core from and I will test over the next week.

I will also look at adding the external export however you might find that this is already done by default in two ways

1) The output files should be copied to your project/debug project/release folder depending on selected configuration (release/debug).

2) Visual micro always uses the same build folder where as arduino uses a temp folder name. Using the same build folder means that you will always be able to find the hex in the same location.  You can see the build folder if you enable "vmicro>compiler>show build folder". Then build and see the CTRL+Click link in the build output.

« Last Edit: Mar 21st, 2018 at 12:18pm by Tim@Visual Micro »  
Back to top
IP Logged
 
NF1Z
Junior Member
**
Offline


Posts: 57
Joined: Aug 18th, 2013
Re: Uploading to Raspberry Pi
Reply #2 - Mar 24th, 2018 at 12:53am
Print Post  
Thanks, Tim.  I am new to RPi myself, but there is an amazing amount of stuff out there.

The particular package I am concentrating on is found on github at

https://github.com/me-no-dev/RasPiArduino

I am not familiar with the Yun, but I wouldn't be surprised if this package doesn't use a lot of the same stuff.  The examples folder has a lot of the same sketches.

There are also some Youtube tutorials, one of which is referenced from the github page and well worth a look, as it takes a simpler approach using the  "Export compiled Binary" command and a shared sketch folder, avoiding a bit of the Linux setup on the Pi, if that's not your cup of tea.  Following on your comments on the export command, I had tried what you suggested, and it does work.  The .bin file looks the same as the .hex file, and the .hex is an ELF file so is of course is is directly executable on the Pi (if built with the right toolchain). All you need is a way to get it there.

Anyhow, it would be good to be have the quick "build and upload" in the VS environment, which I got used to for the AVR, so if you can help that would be great.   I'd also be curious to know why the SSH doesn't already work, when it does in the Arduino IDE?  I don't of course know anything about the internals of VM, and probably don't need to, just curious.

Regards,
Jed

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Uploading to Raspberry Pi
Reply #3 - Mar 25th, 2018 at 1:31pm
Print Post  
Thanks I will take a look.

The Arduino IDE has access to java which is much easier for some of this stuff. 

Normally the tool chain takes care of upload, for example the esp8266 and esp32 use python which visual micro just has to run. However for SSH that had to be redone in C# so we have to constantly look at maintenance.

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint