Stream from T7 to RPi with python | LabJack
 

Stream from T7 to RPi with python

7 posts / 0 new
Last post
jquinnell
jquinnell's picture
Stream from T7 to RPi with python
I have a T7-pro connected to a headless rpi zero and I am reading data with a python script. The data are 9 analog measurements (3 thermopiles and 6 thermocouples). I won't have access to this system after I deploy it.  My python script (attached) summarized:
  1. Open the labjack, 
  2. Stream a few measurements in a while loop
  3. average the measurements
  4. Close labjack
  5. open a file in append, append row to data file, close file
  6. send the average data to initialstate.com

Right now I have a cron job to execute this script every minute. At some point (minutes/hours) the script fails to contact the labjack with errors 1227 or 1239.

Is this an issue with my approach? The rpi? T7? Is there a better way to go about this?
File Attachment: 
LabJack Support
labjack support's picture
Hello,

Hello,

Your approach looks alright, though you could try adding a retry on ljm.openS. For example: you could try to open the device 10 times using try/except in a loop.

To help us debug, please answer some questions:

  • What kind of connection? USB, Ethernet, or Wifi?
  • What version of LJM are you using? You can check by reading LJM_LIBRARY_VERSION, and you can try upgrading to the latest beta version.

I'm noticing in the LJM changelog that there are some fixes that look relevant to your issue, but the available releases are old. I'll add a new LJM release so you can try it out. I will update this thread when it's available.

jquinnell
jquinnell's picture
I am running a USB connection

I am running a USB connection with ljm version 1.07. I will try upgrading, is there a newer version for ARMv6? I do not see one beyond 1.07. Thanks

LabJack Support
labjack support's picture
Sorry for the delay; we're

Sorry for the delay; we're working on releasing a new version. I will update this thread when it's ready.

jquinnell
jquinnell's picture
great. thanks for the follow

great. thanks for the follow up.

jquinnell
jquinnell's picture
Can you update on when this

Can you update on when this will be available? Thanks

LabJack Support
labjack support's picture
Sorry about the delay. There

Sorry about the delay. There is a new beta release for ARMv6:

https://labjack.com/support/software/installers/ljm