How to share data between Raspberry pi's?
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
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
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
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.
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.
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.
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]
[--get_measurement ID UNIT CHANNEL]
[--lcd_backlight_on LCDID] [--lcd_backlight_off LCDID]
[--lcd_reset LCDID] [--output_state OUTPUTID]
[--outputoff OUTPUTID] [--outputon OUTPUTID]
[--duration SECONDS] [--dutycycle DUTYCYCLE]
[--trigger_all_actions FUNCTIONID] [-t]
mycodo_client.py: error: argument --get_measurement: expected 3 arguments