NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Linux RT system update remotely?

Hi all,

We need to have some way to remotely update NI linux RT system (sbRio 9651 SOM). SbRIO is connected to the host computer via ethernet. System image update would be easy if we could use NI SW on the host computer, but in this case we can not use. What would be best and most reliable way to do update without NI SW on the host computer?

I think that we have to make some self update routine to the sbRIO LV code. There is available example code to update system using USB memory stick in system. I think that we could use that as a basis. What do you think?

Thanks for your help.

Marko

0 Kudos
Message 1 of 7
(5,695 Views)

Hi Marko,

What software are you interested in updating remotely? The actual LV application itself? I ask since the answer changes based on specifically what you meant.

A simple example of what sort of functionality you're looking for would be helpful.

0 Kudos
Message 2 of 7
(3,423 Views)

Hi Brad

I'm interested to update whole system image. Only LV application updating might be also option, but it would better if whole system can be updated. First SW installation to clean sbRIO is done with NI application.

I'm lookin this kind of functionality. New system image is transfered first to the host computer that dont't have any NI SW installed. Update process is startted sending command (via ethernet) to the sbRIO and new system image is loaded to the sbRIO. sbRIO restarts after update and new system image is running.

The current sbRIO LV application uses simple ascii TCP connection for communication with host computer. Also FTP connection is used to transfed data from sbRIO to host computer. I would like to use these connections for the system update. Python script is used on the host computer for the communication functions.

I hope this clarify my problem.

/Marko

  

0 Kudos
Message 3 of 7
(3,423 Views)

NI has some system imaging functionality, however I'm not sure if it is available without being run from LV on a development PC.

That said, there's still a possibility to get something working without using the existing system imaging script, but it's going to be quite a bit of work.

Basically, it would involve

  1. downloading the new image to the target
  2. switching the system into single-user mode (runlevel 1)
    • ensuring that all processes other than init have been stopped
  3. extracting the contents of the image to your new image
  4. returning to the normal system runlevel

This is not completely ideal as it leaves some old remnants of the previous image around, but this could be solved with a temporary chroot to a reasonable rootfs (that has the actual root filesystem bind-mounted into a subdirectory of the new, temporary rootfs).

It's complex and could leave you with a system that has to be force-booted to safemode to recover, so hopefully there's some ability to use the existing NI imaging stuff without LV

0 Kudos
Message 4 of 7
(3,423 Views)

Hey Brad,

Heres a few clarying points.

You should only need the system configuration runtime for the  host pc to deploy a system image to a RT target. See the Replication and Deployment utility for the minimum software needed.

If you want to remove the host from the equation then system can be installed to the cRIO/sbRIO which can then deploy and image on top of itself if you save it to an external drive. Linux RT targest are unique in that this will work so it could be hold a user button to indicate you want to upgrade the target internal software and it can attempt to read from a flash drive to update and deploy an image stored there.

You can also make a component definition to get your application to show up in max as another component so if you prefer to use max to install software then your applciation can show up there as well. This is defined in the real-time help I believe. You would need most of the labview development software installed to ensure all available libraries that can be installed are available.

Kyle Hartley
Senior Embedded Software Engineer

0 Kudos
Message 5 of 7
(3,423 Views)

Hey Marko,

A couple questions for you about this problem. What OS is the host machine running? Do you need absolutely no NI Software at all on the host system, or would a dll or two be ok if they were called from a C application or a python script?

Thanks,

Sebastian

0 Kudos
Message 6 of 7
(3,423 Views)

Hi all,

Here is solution where we ended up with remote system image update without NI SW on the host computer. LV application on the SOM module has self update routine that is made using NI system configuration VIs. System image can be updated from the USB flash memory in the system boot. Image version on the USB flash memory and in system are checked in the begining of the LV code. System image is updated if versions don't match.

With this functionality the remote update via ethernet is pretty easy to do using just python script. We have python script that transfers system image files to USB flash drive of the SOM board. File transfer is done with FTP, because I wasn't able to use webdav from python. I tried python easywebdav module for file transfer, but it always complains  "401 Unauthorized". Webdav works fine from windows explorer. At this point FTP is ok, but in the future it would be nice to use more secure webdav for file transfer. When the system image files are transfered to the USB flash drive I send "update" command over "TCP socket" connection and system updates itself.

One bad thing in this case is that we have to have USB flash stick plugged to the SOM device.

Thanks all for the help,

Marko

Message 7 of 7
(3,423 Views)