Raspberry Pi talk to Infinisolar

not2bme said:
Yeah that video is old. Daromer updated the code with his new solar-sis package and that is probably the old code you're looking at.

This is what you should be getting. I didn't go too far with his version because it didn't fit my needs but here's what it looks like on my pi:

root@grafpi:/energy-logger/solar-sis/example/PIP4084# ls -las
total 28
4 drwxr-xr-x 3 root root 4096 Dec 12 16:01 .
4 drwxr-xr-x 5 root root 4096 Dec 12 02:52 ..
4 -rwxr-xr-x 1 root root 3075 Apr 18 22:12 calls.json
4 drwxr-xr-x 189 root root 4096 Dec 12 16:03 node_modules
4 -rw-r--r-- 1 root root 103 Dec 12 02:52 package.json
4 -rwxr-xr-x 1 root root 1622 Dec 12 02:52 project.js
4 -rwxr-xr-x 1 root root 864 Apr 23 19:31 session.json
root@grafpi:/energy-logger/solar-sis/example/PIP4084# node project.js
[2018-04-29 16:09:58] http localhost Listening on port: 3001
[2018-04-29 16:09:58] info serial:/dev/hidraw0 Open serial port
[2018-04-29 16:09:58] info queue:ADD_INTERVAL query/general_status:QPIGS
[2018-04-29 16:09:58] info queue:ADD_INTERVAL query/device_rated_information:QPIRIT
[2018-04-29 16:10:00] info serial:/dev/hidraw0:RECIVED_RAW Data: (B?? Length: 4
[2018-04-29 16:10:00] info serial:/dev/hidraw0:RECIVED_RAW Data: (123.3 59.9 120.1 60.0 0240 0211 008 225 28.50 004 053 0035 0012 089.3 28.50 00000 00010110 00 00 00342 110?P Length: 112
[2018-04-29 16:10:01] info serial:/dev/hidraw0:RECIVED_RAW Data: (120.0 25.0 120.0 60.0 13.0 3000 2400 24.0 25.5 23.0 28.7 28.6 2 10 050 0 2 3 6 10 0 0 26.0 0 0?? Length: 99
[2018-04-29 16:10:08] info serial:/dev/hidraw0:SEND query/general_status
[2018-04-29 16:10:08] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
[2018-04-29 16:10:09] info serial:/dev/hidraw0:RECIVED_RAW Data: (123.4 59.9 120.2 60.0 0240 0215 008 226 28.50 003 053 0035 0012 089.3 28.50 00000 00010110 00 00 00342 110?? Length: 115
[2018-04-29 16:10:09] info serial:/dev/hidraw0:RECIVED query/general_status
[2018-04-29 16:10:09] info influx:SEND pip_query_general_status grid_voltage=123.4,grid_frecuency=59.9,ac_output_voltage=120.2,ac_output_frecuency=60,ac_output_power_va=240,ac_output_active_power=215,output_load_percent=8,bus_voltage=226,battery_voltage=28.5,battery_charging_current=3,battery_capacity=53,inverter_heat_sink_temperature=35,pv_input_current_for_battery=12,pv_input_voltage_1=89.3,battery_voltage_from_scc=28.5,battery_discharge_current=0,device_status=00010110,charging_scc=1,charging_ac=1,charging_scc_acc=0
^C
root@grafpi:/energy-logger/solar-sis/example/PIP4084#

thanx, this now got me onto something ;)
I don't know Node.js at all, so I don't really know how to log this info in the DB, but will poke around a bit.

As matter of interest, how do you get stats off your machine now?
 
SiverNodashi said:
thanx, this now got me onto something ;)
I don't know Node.js at all, so I don't really know how to log this info in the DB, but will poke around a bit.

As matter of interest, how do you get stats off your machine now?

The info gets logged into influxdb. It's not a relational database and is a time series database. The way it logs data is that it does a HTTP POST to http://localhost:8086/write?db=powerwall and sends in a json string. So the node.js just outputs a JSON data into that HTTP url that is specified in the sessions.json file. By default if you use the ISO it should work if there's no error on the console. I didn't have to fiddle anything to get it to work when I used the ISO.

Then you load up grafana at http://localhost:3000 with user/pass admin/admin. And then load up the PIP4048 dashboard. Nothing will show up because the dashboard must have been old and it doesn't reference the right series/table. The one thing you want to do first is go into a panel and click on edit.Then select the general_status
series/table


image_ohbepy.jpg



I don't know node.js as well and my programming skills is more basic so when it come to object oriented stuff I get lost. So when I needed to merge some data, and since influxdb isn't relational I couldn't figure it out. I then changed from using the solar-sis to nrm21's skymax fork on github which is written in c++ and is much more straightforward so I used that instead.
 
not2bme said:
SiverNodashi said:
thanx, this now got me onto something ;)
I don't know Node.js at all, so I don't really know how to log this info in the DB, but will poke around a bit.

As matter of interest, how do you get stats off your machine now?

The info gets logged into influxdb. It's not a relational database and is a time series database. The way it logs data is that it does a HTTP POST to http://localhost:8086/write?db=powerwall and sends in a json string. So the node.js just outputs a JSON data into that HTTP url that is specified in the sessions.json file. By default if you use the ISO it should work if there's no error on the console. I didn't have to fiddle anything to get it to work when I used the ISO.

Then you load up grafana at http://localhost:3000 with user/pass admin/admin. And then load up the PIP4048 dashboard. Nothing will show up because the dashboard must have been old and it doesn't reference the right series/table. The one thing you want to do first is go into a panel and click on edit.Then select the general_status
series/table


image_ohbepy.jpg



I don't know node.js as well and my programming skills is more basic so when it come to object oriented stuff I get lost. So when I needed to merge some data, and since influxdb isn't relational I couldn't figure it out. I then changed from using the solar-sis to nrm21's skymax fork on github which is written in c++ and is much more straightforward so I used that instead.

Thanx for the tips! This helped a lot! I have looked at skymax but it only supports the PIP4048 inverters, and not the MPI10Kwh inverter. My knowledge about C++ is much less than NodeJS.

I now have some stats in Grafana, now I just need to figure out how to publish it to pvoutput.org and emoncms.org.
 
not2bme said:
Yeah that video is old. Daromer updated the code with his new solar-sis package and that is probably the old code you're looking at.

This is what you should be getting. I didn't go too far with his version because it didn't fit my needs but here's what it looks like on my pi:

root@grafpi:/energy-logger/solar-sis/example/PIP4084# ls -las
total 28
4 drwxr-xr-x 3 root root 4096 Dec 12 16:01 .
4 drwxr-xr-x 5 root root 4096 Dec 12 02:52 ..
4 -rwxr-xr-x 1 root root 3075 Apr 18 22:12 calls.json
4 drwxr-xr-x 189 root root 4096 Dec 12 16:03 node_modules
4 -rw-r--r-- 1 root root 103 Dec 12 02:52 package.json
4 -rwxr-xr-x 1 root root 1622 Dec 12 02:52 project.js
4 -rwxr-xr-x 1 root root 864 Apr 23 19:31 session.json
root@grafpi:/energy-logger/solar-sis/example/PIP4084# node project.js
[2018-04-29 16:09:58] http localhost Listening on port: 3001
[2018-04-29 16:09:58] info serial:/dev/hidraw0 Open serial port
[2018-04-29 16:09:58] info queue:ADD_INTERVAL query/general_status:QPIGS
[2018-04-29 16:09:58] info queue:ADD_INTERVAL query/device_rated_information:QPIRIT
[2018-04-29 16:10:00] info serial:/dev/hidraw0:RECIVED_RAW Data: (B?? Length: 4
[2018-04-29 16:10:00] info serial:/dev/hidraw0:RECIVED_RAW Data: (123.3 59.9 120.1 60.0 0240 0211 008 225 28.50 004 053 0035 0012 089.3 28.50 00000 00010110 00 00 00342 110?P Length: 112
[2018-04-29 16:10:01] info serial:/dev/hidraw0:RECIVED_RAW Data: (120.0 25.0 120.0 60.0 13.0 3000 2400 24.0 25.5 23.0 28.7 28.6 2 10 050 0 2 3 6 10 0 0 26.0 0 0?? Length: 99
[2018-04-29 16:10:08] info serial:/dev/hidraw0:SEND query/general_status
[2018-04-29 16:10:08] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
[2018-04-29 16:10:09] info serial:/dev/hidraw0:RECIVED_RAW Data: (123.4 59.9 120.2 60.0 0240 0215 008 226 28.50 003 053 0035 0012 089.3 28.50 00000 00010110 00 00 00342 110?? Length: 115
[2018-04-29 16:10:09] info serial:/dev/hidraw0:RECIVED query/general_status
[2018-04-29 16:10:09] info influx:SEND pip_query_general_status grid_voltage=123.4,grid_frecuency=59.9,ac_output_voltage=120.2,ac_output_frecuency=60,ac_output_power_va=240,ac_output_active_power=215,output_load_percent=8,bus_voltage=226,battery_voltage=28.5,battery_charging_current=3,battery_capacity=53,inverter_heat_sink_temperature=35,pv_input_current_for_battery=12,pv_input_voltage_1=89.3,battery_voltage_from_scc=28.5,battery_discharge_current=0,device_status=00010110,charging_scc=1,charging_ac=1,charging_scc_acc=0
^C
root@grafpi:/energy-logger/solar-sis/example/PIP4084#

Mine doesn't get that far, it gives an error:


Code:
pi@grafpi ~ $ sudo su
root@grafpi:/home/pi# cd /energy-logger/
root@grafpi:/energy-logger# cd /energy-logger/solar-sis/example/PIP4084
root@grafpi:/energy-logger/solar-sis/example/PIP4084# ls -las
total 28
4 drwxr-xr-x   3 root root 4096 May  1 08:07 .
4 drwxr-xr-x   5 root root 4096 Dec 12 09:52 ..
4 -rwxr-xr-x   1 root root 3075 Apr 30 05:00 calls.json
4 drwxr-xr-x 189 root root 4096 Dec 12 23:03 node_modules
4 -rw-r--r--   1 root root  103 Dec 12 09:52 package.json
4 -rwxr-xr-x   1 root root 1622 Apr 30 05:01 project.js
4 -rwxr-xr-x   1 root root  860 Dec 12 09:52 session.json
root@grafpi:/energy-logger/solar-sis/example/PIP4084# node project.js
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::3001
    at Object.exports._errnoException (util.js:1020:11)
    at exports._exceptionWithHostPort (util.js:1043:20)
    at Server._listen2 (net.js:1262:14)
    at listen (net.js:1298:10)
    at Server.listen (net.js:1394:5)
    at EventEmitter.listen (/energy-logger/solar-sis/example/PIP4084/node_modules/express/lib/application.js:618:24)
    at mpi.init (/energy-logger/solar-sis/example/PIP4084/node_modules/solar-sis/index.js:621:7)
    at Object.<anonymous> (/energy-logger/solar-sis/example/PIP4084/project.js:59:7)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)

Not sure what that means though.
 
daromer said:
Siver please read and check the page again. No the MPI is not the same as PIP. they uses different protocol. But included in that software you have the protocol included for PIP4x series, MPI series and the PCM series.

The link you pasted look exactly like the PIP4048 protocol I have been using to my PIP inverter here at home.

@daromer, can your script talk to, and gather stats from more than 1 inverter? I have 3 connected in parallel, but only seem to have been able to gather stats from a single inverter.
 
You need 1 running for each inverter. I have 4 running at home collecting. Just beware of that the Raspberry can become unstable if you power to many USB to serial adaptors :)
You then need to configure correct port for each one of them and where to store them in the database.
 
daromer said:
You need 1 running for each inverter. I have 4 running at home collecting. Just beware of that the Raspberry can become unstable if you power to many USB to serial adaptors :)
You then need to configure correct port for each one of them and where to store them in the database.

Hi,

I was hoping it wouldn't come to that, as it just add more cost and complexity with wiring. Is it at all possibly to talk to all 3 inverters from a single Pi?
 
Why would it be more complex? Are you hooking up your inverters wireless? If not you still need the same amount of wires no matter if you have 1 or 10. Just start another version of the software but configure proper port to talk to the inverter.


As I said "I have 4 running at home collecting"... = I have 4 units hooked up to same raspberry pi that have 4 instances of the software running. You can have as many as you want but you need to make sure your raspberry will cope with the USB to serial adaptors or what you choose to use.
 
daromer said:
Why would it be more complex? Are you hooking up your inverters wireless? If not you still need the same amount of wires no matter if you have 1 or 10. Just start another version of the software but configure proper port to talk to the inverter.


As I said "I have 4 running at home collecting"... = I have 4 units hooked up to same raspberry pi that have 4 instances of the software running. You can have as many as you want but you need to make sure your raspberry will cope with the USB to serial adaptors or what you choose to use.

Hi,

Ok, so I misunderstood. I can have only 1 Pi, but run 3x USB cables from the Pi, right?

But how do I graph all 3 inverters then? I presume the 3 inverters would appear as /dev/hidraw0, /dev/hidraw1 and /dev/hidraw2? But when next? The script only allows for one instance of /dev/hidraw*
 
Yes you run 3 instances of the software. Copy the folder for instance PIP1 PIP2 PIP3... Then configure each one of them. Setup Systemd if thats what you use and run it


But as I said the PI can have problem with many usb devices towards it. If so use external USB active hub
 
daromer said:
Yes you run 3 instances of the software. Copy the folder for instance PIP1 PIP2 PIP3... Then configure each one of them. Setup Systemd if thats what you use and run it


But as I said the PI can have problem with many usb devices towards it. If so use external USB active hub

Oh ok.
There is a parallel protocol for the PIP4048 inverter which could effectively allow your app to talk to all inverters connected via the communications cables. I am just not sure where to get it.


I have a strage issue. The past two mornings, I noticed that the solar_pip software stopped graphing any stats. Then I restart it, and it's fine.

Looking at the log, I saw this:

Code:
root@grafpi:~# tail -f /var/log/solar_pip.log
Jun  8 06:35:01 grafpi solar_pip[456]: [2018-06-08 06:35:01] info serial:/dev/hidraw0:SEND query/general_status
Jun  8 06:35:01 grafpi solar_pip[456]: [2018-06-08 06:35:01] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0 Reciving reached threshold 12406ms (10000ms)
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] WARN serial:/dev/hidraw0 Close serial port
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] info serial:/dev/hidraw0 Open serial port
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0 Error: Error Resource temporarily unavailable Cannot lock port
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0     at Error (native)
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0  { Error: Error Resource temporarily unavailable Cannot lock port
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0     at Error (native)
Jun  8 06:35:14 grafpi solar_pip[456]: [2018-06-08 06:35:14] ERR! serial:/dev/hidraw0   stack: 'Error: Error Resource temporarily unavailable Cannot lock port\n          at Error (native)' }
^C
root@grafpi:~# dmesg | grep hidraw


Have you seen this before?
 
Yes its due to the connection between nthe raspberry pi and the inverter. The issue is that the raspberry pi drops the connection in a strange way or even locks the port. With that said we are just testing a work around in the software to cope with it.
I dont get that error that often in my system but had it with the old wires.
It might be that we just simply need to set delay between close and open to avoid most of the issues.
 
Btw *experimental*

in the folder you run it run "npm update" We have an updated version and i suspect you havent installed that. That version have fixes for above.

Before you do that make sure to make a backup of all ur files!!

Im about to test it out this weekend before i push it into new iso
 
daromer said:
Yes its due to the connection between nthe raspberry pi and the inverter. The issue is that the raspberry pi drops the connection in a strange way or even locks the port. With that said we are just testing a work around in the software to cope with it.
I dont get that error that often in my system but had it with the old wires.
It might be that we just simply need to set delay between close and open to avoid most of the issues.

I don't see if often either. In fact, I think the last time was about 3 weeks ago. And I couldn't figure out why it does it. A simple restart "fixes" the problem temporarily.
 
daromer said:
Btw *experimental*

in the folder you run it run "npm update" We have an updated version and i suspect you havent installed that. That version have fixes for above.

Before you do that make sure to make a backup of all ur files!!

Im about to test it out this weekend before i push it into new iso

Hi,

Did the fix work on your side?
I see there are two updated files on github, "index.js" and "package.json", which I downloaded to the correct folder but this morning I got the error again:

Code:
root@grafpi:~# tail -f /var/log/solar_pip.log
Jun 19 06:36:07 grafpi solar_pip[2295]: [2018-06-19 06:36:07] info serial:/dev/hidraw0:SEND query/general_status
Jun 19 06:36:07 grafpi solar_pip[2295]: [2018-06-19 06:36:07] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
Jun 19 06:36:17 grafpi solar_pip[2295]: [2018-06-19 06:36:17] ERR! serial:/dev/hidraw0 Reciving reached threshold 10026ms (10000ms)
Jun 19 06:36:17 grafpi solar_pip[2295]: [2018-06-19 06:36:17] WARN serial:/dev/hidraw0 Close serial port
Jun 19 06:36:17 grafpi solar_pip[2295]: [2018-06-19 06:36:17] info serial:/dev/hidraw0 Open serial port
Jun 19 06:36:18 grafpi solar_pip[2295]: [2018-06-19 06:36:18] ERR! serial:/dev/hidraw0 Error: Error Resource temporarily unavailable Cannot lock port
Jun 19 06:36:18 grafpi solar_pip[2295]: [2018-06-19 06:36:18] ERR! serial:/dev/hidraw0     at Error (native)
Jun 19 06:36:18 grafpi solar_pip[2295]: [2018-06-19 06:36:18] ERR! serial:/dev/hidraw0  { Error: Error Resource temporarily unavailable Cannot lock port
Jun 19 06:36:18 grafpi solar_pip[2295]: [2018-06-19 06:36:18] ERR! serial:/dev/hidraw0     at Error (native)
Jun 19 06:36:18 grafpi solar_pip[2295]: [2018-06-19 06:36:18] ERR! serial:/dev/hidraw0   stack: 'Error: Error Resource temporarily unavailable Cannot lock port\n    at Error (native)' }


Interestingly, it's always at about the same time, though not always on the same day.

and there is no "nmp" command on the IS:

Code:
root@grafpi:/home/pi# cd /energy-logger/solar-sis/
root@grafpi:/energy-logger/solar-sis# nmp update
bash: nmp: command not found
root@grafpi:/energy-logger/solar-sis# apt-get install nmp
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nmp
 
"npm" not nmp... ;) But update will fail so hold off.
 
daromer said:
"npm" not nmp... ;) But update will fail so hold off.

Hi,

Ok, so curiously, does it lock the port (I presume you mean the USB port?) or does something else happen?

I ask, cause this morning again, the data stopped updating just at 06:52am, yet the log doesn't give the error I saw last. Instead, the logs don't run, it "hung" here:


Code:
root@grafpi:/energy-logger#
root@grafpi:/energy-logger# tail -f /var/log/solar_pip.log
Jun 21 19:17:02 grafpi solar_pip[462]: [2018-06-21 19:17:02] info serial:/dev/hidraw0:SEND query/general_status
Jun 21 19:17:02 grafpi solar_pip[462]: [2018-06-21 19:17:02] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
Jun 21 19:17:03 grafpi solar_pip[462]: [2018-06-21 19:17:03] info serial:/dev/hidraw0:RECIVED_RAW Data:
Jun 21 19:17:03 grafpi solar_pip[462]: [2018-06-21 19:17:03] info serial:/dev/hidraw0:RECIVED query/general_status
Jun 21 19:17:03 grafpi solar_pip[462]: [2018-06-21 19:17:03] info influx:SEND pip_query_general_status grid_voltage=217.3,grid_frecuency=50,ac_output_voltage=217.3,ac_output_frecuency=50,ac_output_power_va=217,ac_output_active_power=118,output_load_percent=4,bus_voltage=437,battery_voltage=54,battery_charging_current=1,battery_capacity=100,inverter_heat_sink_temperature=52,pv_input_current_for_battery=0,pv_input_voltage_1=0,battery_voltage_from_scc=0,battery_discharge_current=0,device_status=00010101,charging_scc=1,charging_ac=0,charging_scc_acc=1
Jun 21 19:17:05 grafpi solar_pip[462]: [2018-06-21 19:17:05] info serial:/dev/hidraw0:SEND query/general_status
Jun 21 19:17:05 grafpi solar_pip[462]: [2018-06-21 19:17:05] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,71,83,183,169,13]}]
Jun 21 19:17:06 grafpi solar_pip[462]: [2018-06-21 19:17:06] info serial:/dev/hidraw0:RECIVED_RAW Data:
Jun 21 19:17:06 grafpi solar_pip[462]: [2018-06-21 19:17:06] info serial:/dev/hidraw0:RECIVED query/general_status
Jun 21 19:17:06 grafpi solar_pip[462]: [2018-06-21 19:17:06] info influx:SEND pip_query_general_status grid_voltage=217.2,grid_frecuency=50,ac_output_voltage=217.2,ac_output_frecuency=50,ac_output_power_va=216,ac_output_active_power=110,output_load_percent=4,bus_voltage=437,battery_voltage=54,battery_charging_current=0,battery_capacity=100,inverter_heat_sink_temperature=52,pv_input_current_for_battery=0,pv_input_voltage_1=0,battery_voltage_from_scc=0,battery_discharge_current=0,device_status=00010101,charging_scc=1,charging_ac=0,char


In this case I run "systemctl restart solar_pip" and it started logging again.
But when it gives that other error, "systemctl restart solar_pip" doesn't work.

And it seems like my Pi ran fine for 3 days without getting the error this time.
 
Hi,

I see this morning it crashed again, and interestingly, it crashed at roughly the same time as last:

Code:
root@grafpi:~# tail -f /var/log/solar_pip.log
Jul  7 06:38:58 grafpi solar_pip[13943]: [2018-07-07 06:38:58] info serial:/dev/hidraw0:SEND query/device_rated_information
Jul  7 06:38:58 grafpi solar_pip[13943]: [2018-07-07 06:38:58] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,82,73,248,84,13]}]
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0 Reciving reached threshold 10030ms (10000ms)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] WARN serial:/dev/hidraw0 Close serial port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] info serial:/dev/hidraw0 Open serial port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0 Error: Error Resource temporarily unavailable Cannot lock port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0     at Error (native)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0  { Error: Error Resource temporarily unavailable Cannot lock port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0     at Error (native)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0   stack: 'Error: Error Resource temporarily unavailable Cannot lock port\n    at Error (native)' }
^C
root@grafpi:~# tail -f /var/log/solar_pip.log
Jul  7 06:38:58 grafpi solar_pip[13943]: [2018-07-07 06:38:58] info serial:/dev/hidraw0:SEND query/device_rated_information
Jul  7 06:38:58 grafpi solar_pip[13943]: [2018-07-07 06:38:58] info serial:/dev/hidraw0:SEND_RAW [{"type":"Buffer","data":[81,80,73,82,73,248,84,13]}]
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0 Reciving reached threshold 10030ms (10000ms)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] WARN serial:/dev/hidraw0 Close serial port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] info serial:/dev/hidraw0 Open serial port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0 Error: Error Resource temporarily unavailable Cannot lock port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0     at Error (native)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0  { Error: Error Resource temporarily unavailable Cannot lock port
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0     at Error (native)
Jul  7 06:39:08 grafpi solar_pip[13943]: [2018-07-07 06:39:08] ERR! serial:/dev/hidraw0   stack: 'Error: Error Resource temporarily unavailable Cannot lock port\n    at Error (native)' }


The first time (that I recorded), it crashed at "2018-06-08 06:35:01" and then "2018-06-19 06:36:07", now today at "2018-07-07 06:38:58".


I have looked through the crons (i.e. "crontab -l" /etc/cron.daily, /etc.cron.weekly, etc) and cannot see anything that runs at that time, but it's also clear that it it doesn't happen on the same day of the week, nor exactly say 10 days apart. But it happens at about 6:30am.

Are you perhaps aware of any services running at that time that could cause the problem?


And, I also noticed that the logs, i.e. /var/log/solar_pip disappear. For example, I wanted to see every time it crashed, but it only kept the last few days in the log:

This is the first entry:
Code:
Jul  7 06:17:02 grafpi solar_pip[13943]: [2018-07-07 06:17:02] info serial:/dev/hidraw0:SEND query/general_status
 
My raspberry Pi crashed and it doesn't bootup anymore so I lost all my data and changes made to Grafana over the last few months.
Where do I change your script to output to emoncms.org at the same time as to Grafana? It uses JSON too.
 
SiverNodashi said:
My raspberry Pi crashed and it doesn't bootup anymore so I lost all my data and changes made to Grafana over the last few months.
Where do I change your script to output to emoncms.org at the same time as to Grafana? It uses JSON too.

Heh same thing happened to me, except in my case it was read-only and I managed to save the data. Don't use the Pi as a server. It's not the Pi but the microsd card. It's not meant to handle writes like a hard drive would. The whole influx and grafana takes a toll on it I'd bet. Now I dumped my data into my linux server and the pi is regulated to just sending data, so in event it dies again I could load some sections like swap into memory but I can't be bothered. I'll reimage it with a backup and done.
 
Back
Top