Closed shanrahul closed 2 years ago
no idea. i dont know what your script is doing or what data you are processing suggest you add exception handling to your script and dump the json when a JSONDecodeError is caught
starting from version 0.7.82 (or maybe earlier) a totally unnecessary line appeared in JSON output root@raspberrypi:/opt/Temp/inverter# mpp-solar -p /dev/hidraw0 -P PI30MAX -c QPGS0 -o json MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar') {"_command": "QPGS0", "_command_description": "Parallel Information inquiry", "parallel_instance_number": "Not valid", "serial_number": "92932012101959", "work_mode": "Line Mode", "fault_code": "No fault", "grid_voltage": 228.6, "grid_frequency": 49.92, "ac_output_voltage": 228.6, "ac_output_frequency": 49.92, "ac_output_apparent_power": 525, "ac_output_active_power": 439, "load_percentage": 6, "battery_voltage": 56.7, "battery_charging_current": 0, "battery_capacity": 100, "pv1_input_voltage": 0.0, "total_charging_current": 0, "total_ac_output_apparent_power": 525, "total_output_active_power": 439, "total_ac_output_percentage": 5, "is_scc_ok": 1, "is_ac_charging": 1, "is_scc_charging": 1, "is_battery_over_voltage": 0, "is_battery_under_voltage": 0, "is_line_lost": 0, "is_load_on": 1, "is_configuration_changed": 0, "output_mode": "single machine", "charger_source_priority": "Solar first", "max_charger_current": 90, "max_charger_range": 120, "max_ac_charger_current": 60, "pv1_input_current": 0, "battery_discharge_current": 0, "pv2_input_voltage": 290.9, "pv2_input_current": 1}
Especially when I was parsing it and sending directly to Influx, not with instruments of mpp-solar package. I am not using mqtt at all. how can I get rid of this first line in -json responce?
That was a bug, is it still there in the latest version?
On Wed, 10 Nov 2021, 9:28 pm Viktor, @.***> wrote:
starting from version 0.7.82 (or maybe earlier) a totally unnecessary line appeared in JSON output @.***:/opt/Temp/inverter# mpp-solar -p /dev/hidraw0 -P PI30MAX -c QPGS0 -o json MqttBroker(name='localhost', port=1883, username=None, password=None, results_topic='mpp-solar') {"_command": "QPGS0", "_command_description": "Parallel Information inquiry", "parallel_instance_number": "Not valid", "serial_number": "92932012101959", "work_mode": "Line Mode", "fault_code": "No fault", "grid_voltage": 228.6, "grid_frequency": 49.92, "ac_output_voltage": 228.6, "ac_output_frequency": 49.92, "ac_output_apparent_power": 525, "ac_output_active_power": 439, "load_percentage": 6, "battery_voltage": 56.7, "battery_charging_current": 0, "battery_capacity": 100, "pv1_input_voltage": 0.0, "total_charging_current": 0, "total_ac_output_apparent_power": 525, "total_output_active_power": 439, "total_ac_output_percentage": 5, "is_scc_ok": 1, "is_ac_charging": 1, "is_scc_charging": 1, "is_battery_over_voltage": 0, "is_battery_under_voltage": 0, "is_line_lost": 0, "is_load_on": 1, "is_configuration_changed": 0, "output_mode": "single machine", "charger_source_priority": "Solar first", "max_charger_current": 90, "max_charger_range": 120, "max_ac_charger_current": 60, "pv1_input_current": 0, "battery_discharge_current": 0, "pv2_input_voltage": 290.9, "pv2_input_current": 1}
Especially when I was parsing it and sending directly to Influx, not with instruments of mpp-solar package. I am not using mqtt at all. how can I get rid of this first line in -json responce?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/178#issuecomment-964890945, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNXQ7NDVVEY3TAFBTZLULIUKLANCNFSM5HFHUFMQ .
had my MAX2 inverter offline - revealed only yesterday. will upgrade and revert
Cool.
I have been refactoring (while my own system has been in the midst of change) to allow the fixing of some issues that are design related, so it is possible (or likely) that bugs have been introduced
Good luck 🙃
On Wed, 10 Nov 2021, 9:31 pm Viktor, @.***> wrote:
had my MAX2 inverter offline - revealed only yesterday. will upgrade and revert
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/178#issuecomment-964895012, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNXE2ZFQZ2S2RXLIT53ULIUWJANCNFSM5HFHUFMQ .
If newest release fail, can I have the latest pre refactoring version?
The fix was in the middle of refactoring. Try first and see if it works
On Wed, 10 Nov 2021, 9:45 pm Viktor, @.***> wrote:
If newest release fail, can I have the latest pre refactoring version?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/178#issuecomment-964904316, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNWWH54GL7YYR6SZHQDULIWJHANCNFSM5HFHUFMQ .
0.7.91 - has no first line
And it works like a charm
I'm preparing a python script using the mpp-solar to catch several data from the inverter and write them down to influxdb. So here is my code. When i run the code for a day, sometimes i receive an error like this,
Traceback (most recent call last): File "/home/pi/getdata.py", line 145, in <module> write_influx() File "/home/pi/getdata.py", line 31, in write_influx data_dict_energy_generated = json.loads(payload_energy_generated) File "/usr/lib/python3.7/json/__init__.py", line 348, in loads return _default_decoder.decode(s) File "/usr/lib/python3.7/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
How can i overcome this issue?