mpp-solar icon indicating copy to clipboard operation
mpp-solar copied to clipboard

Issues after partial update of Ubuntu

Open dustinzinnj opened this issue 3 years ago • 43 comments

Tried to get my system updated, what a bad idea. Something broke the conversion of the output into influxdb (v1.8.10) so nothing is being added to the database. I tried removing mppsolar with pip, cleaning out all of influxdb, and removing all mqtt and starting fresh.

I even tried to edit the "mqtt.py" files under /usr/local/bin to see if I could fix the issue myself but none of my changes seemed to matter to the output.

Screenshots attached Screenshot_19 Screenshot_18 Screenshot_17 Screenshot_20

dustinzinnj avatar Apr 20 '22 02:04 dustinzinnj

try taking the space of the tag in the cron line "TEST " cron

jblance avatar Apr 20 '22 03:04 jblance

I've tried that, and even removed the entire -T for the tag. I added that space thinking influxdb wanted to see a space before it would actually add a new measurement to the db.

dustinzinnj avatar Apr 20 '22 05:04 dustinzinnj

Was the error (telegraf one) the same?

I'm no telegraf expert. Do you no the format that telegraf is expecting? It may have changed with a newer version...

On Wed, 20 Apr 2022, 5:17 pm dustinzinnj, @.***> wrote:

I've tried that, and even removed the entire -T for the tag. I added that space thinking influxdb wanted to see a space before it would actually add a new measurement to the db.

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1103480550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNU25Z3M5N77SLWRBUDVF6HNJANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 20 '22 05:04 jblance

Not a clue, I only ever followed your instructions on here to get it working, along with your help back when we found whatever the issue was with my LV2424 setup. Is there some way I can get you that information?

dustinzinnj avatar Apr 20 '22 05:04 dustinzinnj

Or maybe some way to install known working versions that work well with your current release?

dustinzinnj avatar Apr 20 '22 05:04 dustinzinnj

Prolly better to fix it to work with newer versions. Let me google around and see what I can find

On Wed, 20 Apr 2022, 5:58 pm dustinzinnj, @.***> wrote:

Or maybe some way to install known working versions that work well with your current release?

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1103500895, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNXVKW3YUYGPCXRQYCTVF6MJLANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 20 '22 05:04 jblance

Let me know whatever you need for logs and info. If I could get the "mppt.py" or similar files to change when I change the setup inside the files, it would probably work with some odd form. It doesn't seem to ever change the actual output no matter what I change, even down to ruining the code.. It may also be that telegraf and mqtt updated, but influx is still on 1.8, when they're now at version 2?

dustinzinnj avatar Apr 20 '22 06:04 dustinzinnj

Looks like the output into influxdb is a "-" instead of any real information.

"9.201, 162.17.229.201,192.168.0.5 - grafana [20/Apr/2022:11:34:10 -0400] "POST /query?db=mppsolar&epoch=ms HTTP/1.1 {'q': 'SELECT mean("nvalue") FROM "GS" WHERE ("setting" = 'pv1_input_power') AND time >= 1648049578863ms GROUP BY time(3>
 - grafana [20/Apr/2022:11:34:13 -0400] "POST /write?db=mppsolar HTTP/1.1 " 204 0 "-" "Telegraf/1.22.1 Go/1.17.7" 54df8693-c0bf-11ec-9eb9-10e7c6acde81 8073"

I also see "telegraf[43319]: 2022-04-20T01:55:02Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected field at 1:6: TEST" under my /etc/telegraf/telegraf.d when I run cat on it. It's also in the live systemctl status. That plugin name, "mqtt_consumer" isnt a file I see listed nor one I made following your steps. Should I try to make the file and place it somewhere?

dustinzinnj avatar Apr 20 '22 15:04 dustinzinnj

Have you configured telegraf - similar to https://github.com/jblance/mpp-solar/blob/master/docs/MQTT_Influx_Grafana.md#configure-telegraf ? The above link also details the influx setup needed - are these steps all done?

Note the telegraf docs have a message format like below so a tag is required and should turn up as the measurement (with no space)

weather,location=us-midwest temperature=82 1465839830100400200
  |    -------------------- --------------  |
  |             |             |             |
  |             |             |             |
+-----------+--------+-+---------+-+---------+
|measurement|,tag_set| |field_set| |timestamp|
+-----------+--------+-+---------+-+---------+

jblance avatar Apr 20 '22 23:04 jblance

Looks like the output into influxdb is a "-" instead of any real information.

"9.201, 162.17.229.201,192.168.0.5 - grafana [20/Apr/2022:11:34:10 -0400] "POST /query?db=mppsolar&epoch=ms HTTP/1.1 {'q': 'SELECT mean("nvalue") FROM "GS" WHERE ("setting" = 'pv1_input_power') AND time >= 1648049578863ms GROUP BY time(3>
 - grafana [20/Apr/2022:11:34:13 -0400] "POST /write?db=mppsolar HTTP/1.1 " 204 0 "-" "Telegraf/1.22.1 Go/1.17.7" 54df8693-c0bf-11ec-9eb9-10e7c6acde81 8073"

This might be just a function of the web api

I also see "telegraf[43319]: 2022-04-20T01:55:02Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected field at 1:6: TEST" under my /etc/telegraf/telegraf.d when I run cat on it. It's also in the live systemctl status. That plugin name, "mqtt_consumer" isnt a file I see listed nor one I made following your steps. Should I try to make the file and place it somewhere?

inputs.mqtt_consumer is a section in the config file, either /etc/telegraf/telegraf.conf or if you followed the docs in this repo /etc/telegraf/telegraf.d/mqtt-input.conf

jblance avatar Apr 20 '22 23:04 jblance

So I finally got it sort of working, but some tag/fields don't seem to work completely.

Some Examples, along with the entire ET command on PI18 doesn't seem to work.

Apr 20 22:58:03 dustinz-solar telegraf[138908]: 2022-04-21T02:58:03Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:42: "SOLAR,setting=dc/ac_power_direction,unit= value=AC-DC"
Apr 20 22:58:03 dustinz-solar telegraf[138908]: 2022-04-21T02:58:03Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:41: "SOLAR,setting=line_power_direction,unit= value=input"
Apr 20 22:58:03 dustinz-solar telegraf[138908]: 2022-04-21T02:58:03Z E! [inputs.mqtt_consumer] Error in plugin: metric parse error: expected tag at 1:38: "SOLAR,setting=local_parallel_id,unit= value=0"

using crontab or ssh of: sudo /usr/local/bin/mpp-solar -o influx_mqtt -q LOCALHOST -p /dev/ttyUSB0 -P PI18 -c GS

and these exact files Screenshot_21 Screenshot_24 Screenshot_23 Screenshot_22

on these versions InfluxDB shell version: 1.6.4 (the only other influx version other than 1.8.10 that I could find for ubuntu anymore) Telegraf 1.22.1 (git: HEAD fc8301ae) Requirement already satisfied: mppsolar in /usr/local/lib/python3.8/dist-packages (0.9.12) Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from mppsolar) (5.3.1) Requirement already satisfied: paho-mqtt in /usr/local/lib/python3.8/dist-packages (from mppsolar) (1.5.1) Requirement already satisfied: pyserial in /usr/local/lib/python3.8/dist-packages (from mppsolar) (3.5)

dustinzinnj avatar Apr 21 '22 02:04 dustinzinnj

Screenshot_25

It does get into Grafana now, although some info is still MIA for whatever syntax problem there still is.

dustinzinnj avatar Apr 21 '22 03:04 dustinzinnj

I assume that you put the actual password in the outputs.influxdb section looks like units= where there are no units is causing a problem

What version of mpp-solar are you using?

jblance avatar Apr 21 '22 04:04 jblance

Correct on the password.

Seems to be up to date following your instructions, from a quite old version 0.7.49 at newest, and I updated via pip install mppsolar (which gives the versions out above 0.9.12)

dustinzinnj avatar Apr 21 '22 04:04 dustinzinnj

Ok great. I'll make some changes (remive units= if no units are available) and upload to pypi.org so pip can get a new version and we can see if that helps

On Thu, 21 Apr 2022, 4:21 pm dustinzinnj, @.***> wrote:

Correct on the password.

Seems to be up to date following your instructions, from a quite old version 0.7.49 at newest, and I updated via pip install mppsolar (which gives the versions out above 0.9.12)

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1104692239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNSJOGVUPBD6HITBZM3VGDJS3ANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 21 '22 04:04 jblance

Okay, can I remove them just from those that don't have any somehow? Or do I have to just remove the entire units= entirely?

dustinzinnj avatar Apr 21 '22 04:04 dustinzinnj

Just the ones that don't have units. There is logic in the output module that sets units="". Can change that to make a message that doesn't include units

On Thu, 21 Apr 2022, 4:24 pm dustinzinnj, @.***> wrote:

Okay, can I remove them just from those that don't have any somehow? Or do I have to just remove the entire units= entirely?

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1104693909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNXBGJXXTO565LADHIDVGDKBDANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 21 '22 04:04 jblance

If you want me to try a syntax or anything before sending out an update I can, although trying to edit it to just remove those that have no unit info, is probably above my knowledge anytime soon. I barely made it work this much, it took me a few days on and off...

dustinzinnj avatar Apr 21 '22 04:04 dustinzinnj

Prolly easier to just wait

On Thu, 21 Apr 2022, 4:29 pm dustinzinnj, @.***> wrote:

If you want me to try a syntax or anything before sending out an update I can, although trying to edit it to just remove those that have no unit info, is probably above my knowledge anytime soon. I barely made it work this much, it took me a few days on and off...

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1104696117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNWYQO24QUGZTKFE4LTVGDKTPANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 21 '22 04:04 jblance

actually looking at the code, can you try influx2_mqtt output module (ie -o influx2_mqtt )

jblance avatar Apr 22 '22 00:04 jblance

This is how the influx output of "SELECT * FROM mppsolar" looks now:

" 1650603123165067277 SOLAR dustinz-solar 22 mpp-solar 1650603123167764523 SOLAR dustinz-solar 0 mpp-solar 1650603123168035487 SOLAR dustinz-solar 0 mpp-solar 1650603123168254050 SOLAR dustinz-solar 0 mpp-solar 1650603123168441026 SOLAR dustinz-solar 0 mpp-solar 1650603123168637317 SOLAR dustinz-solar 0 mpp-solar 1650603123168818033 SOLAR dustinz-solar 0 mpp-solar 1650603123169015176 SOLAR dustinz-solar Nothing changed mpp-solar 1650603123169199795 SOLAR dustinz-solar abnormal mpp-solar 1650603123169384992 SOLAR dustinz-solar abnormal mpp-solar 1650603123169550760 SOLAR dustinz-solar connect mpp-solar 1650603123169741150 charge SOLAR dustinz-solar mpp-solar 1650603123169913096 SOLAR AC-DC dustinz-solar mpp-solar 1650603123170105884 SOLAR dustinz-solar input mpp-solar 1650603123170282766 SOLAR dustinz-solar 0 mpp-solar

"

dustinzinnj avatar Apr 22 '22 04:04 dustinzinnj

What command are you using? What do the mqtt messages look like?

On Fri, 22 Apr 2022, 4:54 pm dustinzinnj, @.***> wrote:

This is how the influx output of "SELECT * FROM mppsolar" looks now:

" 1650603123165067277 SOLAR dustinz-solar 22 mpp-solar 1650603123167764523 SOLAR dustinz-solar 0 mpp-solar 1650603123168035487 SOLAR dustinz-solar 0 mpp-solar 1650603123168254050 SOLAR dustinz-solar 0 mpp-solar 1650603123168441026 SOLAR dustinz-solar 0 mpp-solar 1650603123168637317 SOLAR dustinz-solar 0 mpp-solar 1650603123168818033 SOLAR dustinz-solar 0 mpp-solar 1650603123169015176 SOLAR dustinz-solar Nothing changed mpp-solar 1650603123169199795 SOLAR dustinz-solar abnormal mpp-solar 1650603123169384992 SOLAR dustinz-solar abnormal mpp-solar 1650603123169550760 SOLAR dustinz-solar connect mpp-solar 1650603123169741150 charge SOLAR dustinz-solar mpp-solar 1650603123169913096 SOLAR AC-DC dustinz-solar mpp-solar 1650603123170105884 SOLAR dustinz-solar input mpp-solar 1650603123170282766 SOLAR dustinz-solar 0 mpp-solar

"

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1106005550, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNRXTHCRVIHINUJ4YQTVGIWJ7ANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 22 '22 04:04 jblance

Command: sudo mpp-solar -o influx2_mqtt -q 127.0.0.1 -p /dev/ttyUSB0 -P PI18 -c GS

No errors using "watch -n 1 systemctl telegraf"

dustinzinnj avatar Apr 22 '22 05:04 dustinzinnj

I also forgot to mention my shorthand (saved me an extra cronjob while troubleshooting, also stopped working. Which would have been: sudo mpp-solar -o influx2_mqtt -q 127.0.0.1 -p /dev/ttyUSB0 -P PI18 -c GS,ET

To send both GS and ET

dustinzinnj avatar Apr 22 '22 05:04 dustinzinnj

Subscribe to the mqtt broker and check the messages generated

On Fri, 22 Apr 2022, 5:15 pm dustinzinnj, @.***> wrote:

Command: sudo mpp-solar -o influx2_mqtt -q 127.0.0.1 -p /dev/ttyUSB0 -P PI18 -c GS

No errors using "watch -n 1 systemctl telegraf"

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1106019014, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNT6JQ4UTDV2RKEAFL3VGIYXXANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 22 '22 05:04 jblance

Looks totally legitimate as far as I can tell..

"dustinz@dustinz-solar:~$ mosquitto_sub -h localhost -v -t "#" mppsolar mppsolar,command=GS grid_voltage=114.0 mppsolar mppsolar,command=GS grid_frequency=59.9 mppsolar mppsolar,command=GS ac_output_voltage=114.0 mppsolar mppsolar,command=GS ac_output_frequency=59.9 mppsolar mppsolar,command=GS ac_output_apparent_power=637 mppsolar mppsolar,command=GS ac_output_active_power=621 mppsolar mppsolar,command=GS output_load_percent=25 mppsolar mppsolar,command=GS battery_voltage=29.2 mppsolar mppsolar,command=GS battery_voltage_from_scc=0.0 mppsolar mppsolar,command=GS battery_voltage_from_scc2=0.0 mppsolar mppsolar,command=GS battery_discharge_current=0 mppsolar mppsolar,command=GS battery_charging_current=1 mppsolar mppsolar,command=GS battery_capacity=100 mppsolar mppsolar,command=GS inverter_heat_sink_temperature=22 mppsolar mppsolar,command=GS mppt1_charger_temperature=0 mppsolar mppsolar,command=GS mppt2_charger_temperature=0 mppsolar mppsolar,command=GS pv1_input_power=0 mppsolar mppsolar,command=GS pv2_input_power=0 mppsolar mppsolar,command=GS pv1_input_voltage=0.0 mppsolar mppsolar,command=GS pv2_input_voltage=0.0 mppsolar mppsolar,command=GS setting_value_configuration_state="Nothing changed" mppsolar mppsolar,command=GS mppt1_charger_status="abnormal" mppsolar mppsolar,command=GS mppt2_charger_status="abnormal" mppsolar mppsolar,command=GS load_connection="connect" mppsolar mppsolar,command=GS battery_power_direction="charge" mppsolar mppsolar,command=GS dc/ac_power_direction="AC-DC" mppsolar mppsolar,command=GS line_power_direction="input" mppsolar mppsolar,command=GS local_parallel_id=0"

dustinzinnj avatar Apr 22 '22 05:04 dustinzinnj

output into influx shows this still in the db

" Nothing changed mppsolar 1650604777941778307 GS dustinz-solar abnormal mppsolar 1650604777941786354 GS dustinz-solar abnormal mppsolar 1650604777941797087 GS dustinz-solar connect mppsolar 1650604777941807000 charge GS dustinz-solar mppsolar 1650604777941851569 GS AC-DC dustinz-solar mppsolar 1650604777941857048 GS dustinz-solar input mppsolar 1650604777941864410 GS dustinz-solar 0 mppsolar

"

dustinzinnj avatar Apr 22 '22 05:04 dustinzinnj

Screenshot_26

dustinzinnj avatar Apr 22 '22 05:04 dustinzinnj

Yeah looks correct to me

Might be the select is just getting the strange values

I'd try hooking grafana up and see what it gives (after running the command a few times)

On Fri, 22 Apr 2022, 5:20 pm dustinzinnj, @.***> wrote:

Looks totally legitimate as far as I can tell..

@.***:~$ mosquitto_sub -h localhost -v -t "#" mppsolar mppsolar,command=GS grid_voltage=114.0 mppsolar mppsolar,command=GS grid_frequency=59.9 mppsolar mppsolar,command=GS ac_output_voltage=114.0 mppsolar mppsolar,command=GS ac_output_frequency=59.9 mppsolar mppsolar,command=GS ac_output_apparent_power=637 mppsolar mppsolar,command=GS ac_output_active_power=621 mppsolar mppsolar,command=GS output_load_percent=25 mppsolar mppsolar,command=GS battery_voltage=29.2 mppsolar mppsolar,command=GS battery_voltage_from_scc=0.0 mppsolar mppsolar,command=GS battery_voltage_from_scc2=0.0 mppsolar mppsolar,command=GS battery_discharge_current=0 mppsolar mppsolar,command=GS battery_charging_current=1 mppsolar mppsolar,command=GS battery_capacity=100 mppsolar mppsolar,command=GS inverter_heat_sink_temperature=22 mppsolar mppsolar,command=GS mppt1_charger_temperature=0 mppsolar mppsolar,command=GS mppt2_charger_temperature=0 mppsolar mppsolar,command=GS pv1_input_power=0 mppsolar mppsolar,command=GS pv2_input_power=0 mppsolar mppsolar,command=GS pv1_input_voltage=0.0 mppsolar mppsolar,command=GS pv2_input_voltage=0.0 mppsolar mppsolar,command=GS setting_value_configuration_state="Nothing changed" mppsolar mppsolar,command=GS mppt1_charger_status="abnormal" mppsolar mppsolar,command=GS mppt2_charger_status="abnormal" mppsolar mppsolar,command=GS load_connection="connect" mppsolar mppsolar,command=GS battery_power_direction="charge" mppsolar mppsolar,command=GS dc/ac_power_direction="AC-DC" mppsolar mppsolar,command=GS line_power_direction="input" mppsolar mppsolar,command=GS local_parallel_id=0"

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1106021189, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNWDCU6F237BUIQS7X3VGIZJXANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 22 '22 05:04 jblance

Yeah it will be hard to read direct from the db

Try grafana, the graph setup will be different to before

On Fri, 22 Apr 2022, 5:22 pm dustinzinnj, @.***> wrote:

[image: Screenshot_26] https://user-images.githubusercontent.com/80711650/164608569-a5af9a7d-6e54-4b34-bd2f-d474bd3acd15.png

— Reply to this email directly, view it on GitHub https://github.com/jblance/mpp-solar/issues/214#issuecomment-1106022152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVKNVO5IW4FECEZCX2BOLVGIZQ7ANCNFSM5T2SAHZA . You are receiving this because you commented.Message ID: @.***>

jblance avatar Apr 22 '22 05:04 jblance