Jump to content

Connecting Arduino to raspberry pi


Recommended Posts

  • 2 years later...
On 3/2/2019 at 1:42 AM, hooovahh said:

If you searched for a long time I assume you found the TSXperts demo here which shows using an Arduino in LabVIEW, on a Pi.

 

Hello, I watched this video but it does not work on Labview 2020. I am trying to do the same but it does not work .. do you have a solution please? 

Link to comment
6 hours ago, Pepito PAYET said:

Hello, I watched this video but it does not work on Labview 2020. I am trying to do the same but it does not work .. do you have a solution please? 

I don't have experience with the TSXperts tools.

I do know that for LabVIEW 2020, you can use the NI LabVIEW LINX Toolkit to program Arduinos and Raspberry Pis.

Link to comment
  • 3 years later...

Hi.

I was doing something similar and thought I'd share my findings here. I wanted to connect Arduino Uno to Raspberry Pi (RPi) with USB cable and use Labview VI deployed locally on RPi to control them both. 

First problem was getting Labview to communicate with RPi. I was using RPi OS (32-bit) Bookworm 2024-07-04 and Labview Community Edition 32-bit Q1/2014.

Labview Tools/Hobbyist/target configuration should be able to make the connection but I never got it working like here: LabVIEW LINX and Raspberry Pi.

(by the way both RPi OS and Labview need to be 32-bit since Hobbyist is only available in 32-bit Labview Community edition). 

The only solution that worked for me was to install RPi OS image with Labview preinstalled and using a specific Labview version (I used Q1/2023). See here: Installing an image with LabVIEW pre installed · LVMakerHub/LINX Wiki · GitHub.

With Labview Q1/2023 now communicating with RPi (OS Raspbian Lite, Bullseye, 2022-09-22) the next problem was to get Labview VI to read sensor data from both RPi and Arduino. I'm quite new to Labview so maybe it was lack of skill but did not get it working. 

A workaround was to have python code on RPi running continuously saving data from Arduino serial port to a text file on RPi SD card and have Labview read the data from there. This way Labview only needed to communicate with RPi. 

At this point I was remotely connected to RPi with Win10 PC which had Labview installed and using the VI from there. But I really wanted Labview to run on its own locally on RPi which according to the first link in this post should be possible. 

And I did get the VI running on RPi but the problem was that Labview front panel is not supported i.e. I could not interact with the VI on RPi using for example a small touchscreen. The VI simply runs locally on RPi but no way to interact with it. 

I also tried the TSXperts demo way but it failed due to Arduino compatible compiler not recognizing the Arduino IDE I had installed (v. 2.3.2). Looks like Arduino compatible compiler was last updated in 2016 so I suspect it would need some modifications to work with newer Arduino IDE.

I did not really understand from their demo how the VI was running on RPI since the compiler loads the VI to Arduino and not RPI. Anyway, I did not get that far to even try it.  

If anyone knows how to run Labview VI locally on Raspberry Pi with front panel visible (like in TSXperts demo) I would be interested to hear it.

Link to comment
  • 3 weeks later...
On 7/26/2024 at 10:53 PM, trippi said:

If anyone knows how to run Labview VI locally on Raspberry Pi with front panel visible (like in TSXperts demo) I would be interested to hear it.

You can have a LabVIEW VI (hierarchy) run on the RPi but you will have to add the RPi as a target to your LabVIEW project. From there you can create a program pretty much in the same way as you would for one of the NI RIO hardware targets such as sbRIO, cRIO, or the myRIO. However the LabVIEW runtime on the RPi is running in its own chroot environment (basically a light-weight Linux Virtual Machine running a Debian OS variant) and is based on the same runtime that NI uses for the ARM based RIO hardware targets. And this runtime has no UI. There is no way to have the VIs running in the RPi, show their front panel on the RPi display. You would have to rely on indirect user display options such as webservices or similar that a webservice client then displays on the actual RPi host or any other network connected device.

Edited by Rolf Kalbermatter
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.