How to share data b...
 

How to share data between Raspberry pi's?  

  RSS

sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
22/05/2019 4:13 am  

Hi, As you know I'm using 2 rpi's with Mycodo to control and monitor.

First rpi has a waveshare ADS1256 A/D converter and second rpi has an 8 channel relay board.

Question is how do I get the ADS1256 data from the first rpi to the second rpi?

Thanks in advance!


Quote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
24/05/2019 5:00 am  

Tried the following on the rpi with the Waveshare pcb but it returned "none"

pi@raspberrypi3_2:~ $ mycodo-client --input_force_measurements 5604a96a-2057-445f-b258-36873a4fc317
2019-05-24 01:54:48,576 [Remote command] Fore acquiring measurements for Input with ID '5604a96a-2057-445f-b258-36873a4fc317': Server returned: None
pi@raspberrypi3_2:~ $ i


ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
25/05/2019 6:32 am  

Update: The previous  post used a uid of an individual analog channel The following uses the uid of  the whole input device. So it looks like its writing  data data to the influx database.    how to access the data?  TIA again:

pi@raspberrypi3_2:~/Mycodo/mycodo $ mycodo-client --input_force_measurements 64a5f8ec-251a-4146-bd39-e17ae4e88ec2
2019-05-25 03:24:51,210 [Remote command] Fore acquiring measurements for Input with ID '64a5f8ec-251a-4146-bd39-e17ae4e88ec2': Server returned: Input instructed to begin acquiring measurements


ReplyQuote
Kyle Gabriel
(@kylegabriel)
Member Admin
Joined: 4 years ago
Posts: 52
30/05/2019 11:40 pm  

I just added a parameter for mycodo_client.py to return the latest value/timestamp for a particular measurement. This will be included in the next release (v7.5.5 ). Here is how this can be used:

mycodo_client.py --get_measurement [ID] [UNIT] [CHANNEL]

Where ID is the Input (or Math, PID, etc.) ID that can be found when hovering your mouse over the disabled button for that particular controller, UNIT is the unit ID that can be found under Config -> Measurement -> Units -> ID Column, and Channel is the channel that can be found if you expand the controller and look under measurement settings.

pi@raspberry:~/Mycodo $ ./env/bin/python ./mycodo/mycodo_client.py --get_measurement 3ca3da6e-aa23-4144-bea3-323da90c529e C 0
SUCCESS;73.06;2019-05-31T03:33:27.918512192Z

The output will be semicolon-separated, with "SUCCESS" or "ERROR" first, the value second, and the timestamp third. If "ERROR" is first, the error string will be second and there will not be a third value.

This post was modified 2 months ago by Kyle Gabriel

Mycodo Developer


sam26k liked
ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
01/06/2019 1:13 am  

Thanks very much for following up on this, Kyle.  Updated to the master and now getting high cpu and GUI and controls are slow.  Since its not a valid release I did not open a new issue.

Thanks again for addressing the original question and let me know if you want more testing.  


ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
05/06/2019 2:34 am  

Tried again to install master 7.5.5  and same problem with rpi3's cpu's running at 100%.  7,5,4  works,  Just wanted to let you know.

 

 
update:  There are a lot of errors in the dameon logs so could be configuration errors.  It looks 7.5.5 may be working  on one of the two rpi's I'm using....
This post was modified 1 month ago by sam26k

ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
10/06/2019 3:09 am  

Hi Kyle,

Finally updated the master  pi with 7.5.5 and cpu% seems to be ok.  Tried the following on the 7.5.5 rpi with the ADS1256 A/D converter and it generated a use error.  What am I doing wrong? TIA!

pi@raspberrypi3_2:~/Mycodo $./mycodo/mycodo_client.py --get_measurement 5604a96a-2057-445f-b258-36873a4fc317

usage: mycodo_client.py [-h] [--activatecontroller CONTROLLER ID]
[--deactivatecontroller CONTROLLER ID]
[--pid_pause ID] [--pid_hold ID] [--pid_resume ID]
[--pid_get_setpoint ID] [--pid_get_error ID]
[--pid_get_integrator ID] [--pid_get_derivator ID]
[--pid_get_kp ID] [--pid_get_ki ID] [--pid_get_kd ID]
[--pid_set_setpoint ID SETPOINT]
[--pid_set_integrator ID INTEGRATOR]
[--pid_set_derivator ID DERIVATOR]
[--pid_set_kp ID KP] [--pid_set_ki ID KI]
[--pid_set_kd ID KD] [-c] [--ramuse]
[--input_force_measurements INPUTID]
[--get_measurement ID UNIT CHANNEL]
[--lcd_backlight_on LCDID] [--lcd_backlight_off LCDID]
[--lcd_reset LCDID] [--output_state OUTPUTID]
[--output_currently_on OUTPUTID]
[--outputoff OUTPUTID] [--outputon OUTPUTID]
[--duration SECONDS] [--dutycycle DUTYCYCLE]
[--trigger_action ACTIONID]
[--trigger_all_actions FUNCTIONID] [-t]
mycodo_client.py: error: argument --get_measurement: expected 3 arguments


ReplyQuote
sam26k
(@sam26k)
Eminent Member
Joined: 5 months ago
Posts: 31
11/06/2019 9:46 pm  

 Re-read your post above and got a success message with the data.  Thanks.


ReplyQuote