-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Done some work on a 4G stick #4
Comments
Hi Darren, Well done, I thought they may have encrypted the data stream this time which would have made this method very difficult. I'm away at the moment with only a tablet so I will have a closer look when I get home in a couple of weeks. |
Graham.0 |
Coincidentally, my Solar setup, and results very similar to yours, 15 panels, 3.6kw Solis G4, south east facing. And with very similar daily outputs, topping at peak sun angles and clear sun late mornings at a fraction below 3kw. |
Hi graham-currie,
My project is out of date now. The 4th gen sticks send their info
in a different format, there are several people who have now decoded the
4th gen sticks, some using my project as a starting point.
Yes there are some lights inside the plastic, but the stick is only
powered up when the inverter is awake. It goes into a sleep state when
there is no light on the panels. I do recall my Wi-Fi stick getting
confused when plugging it in and out. The best bet is to power the
inverter down by switching off all the isolator switches, usually the DC
switch(s) first then the AC. Plug the stick back in, wait several
minutes, even half an our, there are a lot of charged capacitors that
need to discharge in the inverter, then power back up again, AC first.
You don't need any sort of Wi-Fi analyser, and it shouldn't be hidden. I
don't think you can change the access point name or turn it off the
Wi-Fi on a stick that doesn't have an ethernet port.
Thanks for the comments about the web pages. I did it to prove to myself
that I was actually saving some money. My system has been running for
nearly 3 years now and the predictions and assumptions I made on the
website are surprisingly accurate. My total bill for Gas and Electricity
is just over £200 for the year. I'm really pleased with that. You should
see your system topping out at 3.6kW in March/April. As it gets warmer
the panels are less efficient, so the peak output falls slightly.
Hope this helps.
Regards Graham0
…On 18/02/2019 23:26, graham-currie wrote:
Graham.0
Just discovered this project when looking for info on the Solis WiFi
logging ‘stick’.
Very impressed by your webpage data output, and by the amount of info
collected there. It’s been a couple of decades since I did some very
basic coding, and a few simple electronic projects, skills now long lost!
I’m having problems with initial setup of the stick. I was able to see
SSID, log on and link to server. However, it then disappeared from
network ( even when searched for as ‘hidden SSID). A very simple
question. When first plugged in, I saw red then green lights
illuminated through the semi translucent case. Even if I start from
scratch again, (switch off inverter, back on, wait for initialisation,
plug in stick, then no sign of any red / green llights, or WiFi signal
on network, or direct from the stick.
Does your stick have any internal lights showing under normal
operation. Maybe I am looking for a non existent WiFi signal, if it
should ‘light up’, and the lack of lights is because it’s got a
problem. (I have no fancy hardware WiFi discovering device, only
software network analysis, and looking for it as a known (hidden)
SSID. Any suggestions, before I admit failure and return it as faulty
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANoebguMSlev82qnDSMsVvwVDpmSyvNLks5vOzbBgaJpZM4QB64z>.
|
Many thanks for quick and comprehensive reply. All as I expected, but As you suggest, I could try waiting for significantly longer than a few minutes before powering back up. Especially as you seem to recall it getting confused’ when plugging in and out.... and I’ve done plenty of that in attempting to get it to show signs of life. |
Hi again graham-currie,
I have a conventional hot water storage here that supplies hot
water to the whole house. It was originally heated by gas only, I fitted
an emersion heater when I had the panels installed. I have a Solar
iBoost to divert spare electricity to heat the water. It costs me about
50p/day to heat the water with gas, from about March to October I vary
rarely need to use gas at all.
Hope your Wi-Fi stick has come back to life. Looking forward to a bit
more sunshine now. Last year was my best year!
Graham
…On 19/02/2019 18:30, graham-currie wrote:
Many thanks for quick and comprehensive reply. All as I expected, but
As you suggest, I could try waiting for significantly longer than a
few minutes before powering back up. Especially as you seem to recall
it getting confused’ when plugging in and out.... and I’ve done plenty
of that in attempting to get it to show signs of life.
You have impressive low energy costs. We have only had p.v. panels up
for 2 weeks, and main reason I want to monitor elec generation and
usage is to calculate optimum size for a new mains pressure / unvented
h.w. cylinder. (h.w. currently from gas combi). I already have a Solic
200 ‘diverter’ and cabling to the proposed cylinder location, but
still working out options; possibly separating off kitchen and family
bathroom onto solar immersion, but keeping our attic room en-suite
bathroom / shower from combi, so always have that option when not much
solar available. Fortunately, our pipe routes look as though the
separating into 2 circuits may be relatively easy.
Gas being relatively cheap per KWh compared to electric, I only want
to make use of electric water heating when ‘free’ surplus solar
available. Meanwhile, I think if I base the generation figures on your
data it will be of use to me. Especially as I want to install before I
will have typical year round figures. So again, thanks for making the
data available to more than just yourself .
All best
Graham
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ANoebgl-Dnr0ks6kvX3FrsjnGIKNBPEFks5vPEKsgaJpZM4QB64z>.
|
Hello again.
The 'stick' is cleary non functional, now being returned, and a replacement
already on its way.
There is quite a lot of quality info available on the inverter itself,
though even that has a few anomolies.
e.g somewhere It states shutdown sequence as AC first then DC, then startp
also as AC then DC.
I had already thought this was illogical first because most shutdown /
startup operations would be the reverse operation,
and secondly, because after dark, the DC has effectively shut itself down
anyway while AC still live.
Solis seem a bit too confident that the stick is a simple plug and play, so
little info on how it should work, or fault finding.
Not even any mention of any coloured lights, which I would assume are there
to inform, rather than to be pretty!
I'm not assuming, or basing any calculations on last summer.
Unfortunately I think endless sunny days most of the summer will remain an
exception.
At least this week lokking good so far.
Regards
Graham
…On Wed, 20 Feb 2019 at 12:53, graham0 ***@***.***> wrote:
Hi again graham-currie,
I have a conventional hot water storage here that supplies hot
water to the whole house. It was originally heated by gas only, I fitted
an emersion heater when I had the panels installed. I have a Solar
iBoost to divert spare electricity to heat the water. It costs me about
50p/day to heat the water with gas, from about March to October I vary
rarely need to use gas at all.
Hope your Wi-Fi stick has come back to life. Looking forward to a bit
more sunshine now. Last year was my best year!
Graham
On 19/02/2019 18:30, graham-currie wrote:
>
> Many thanks for quick and comprehensive reply. All as I expected, but
> As you suggest, I could try waiting for significantly longer than a
> few minutes before powering back up. Especially as you seem to recall
> it getting confused’ when plugging in and out.... and I’ve done plenty
> of that in attempting to get it to show signs of life.
> You have impressive low energy costs. We have only had p.v. panels up
> for 2 weeks, and main reason I want to monitor elec generation and
> usage is to calculate optimum size for a new mains pressure / unvented
> h.w. cylinder. (h.w. currently from gas combi). I already have a Solic
> 200 ‘diverter’ and cabling to the proposed cylinder location, but
> still working out options; possibly separating off kitchen and family
> bathroom onto solar immersion, but keeping our attic room en-suite
> bathroom / shower from combi, so always have that option when not much
> solar available. Fortunately, our pipe routes look as though the
> separating into 2 circuits may be relatively easy.
> Gas being relatively cheap per KWh compared to electric, I only want
> to make use of electric water heating when ‘free’ surplus solar
> available. Meanwhile, I think if I base the generation figures on your
> data it will be of use to me. Especially as I want to install before I
> will have typical year round figures. So again, thanks for making the
> data available to more than just yourself .
> All best
> Graham
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/ANoebgl-Dnr0ks6kvX3FrsjnGIKNBPEFks5vPEKsgaJpZM4QB64z
>.
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AtQTmm_8MBjJBLkWVRWfb4G182TtMyMgks5vPUVCgaJpZM4QB64z>
.
|
Hi Graham, Regards, |
Thanks flamegrilled, |
Hi Graham,
Thank you for your email.
Our temp in Cape Town is 31.5 deg C @ 15:33 GMT+2
I have got to a point where Darren's and your merged scripts are running
and connecting to the mosquitto broker on HA.I see no data
The mission continues.
Regards,
Sean
…On Thu, Dec 5, 2019 at 12:12 PM graham0 ***@***.***> wrote:
Thanks flamegrilled,
Hope it works OK, don't think there will be much sun today though! My
system is only generating 120W as I write this.
Graham
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=AN6RDDSSNP3TEOSWSECWRLLQXDHXHA5CNFSM4EAHVYZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGAGGKY#issuecomment-562062123>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDX4QFBANTGCEQXABX3QXDHXHANCNFSM4EAHVYZQ>
.
|
Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have your script running on a Raspi nearby. It is listening but doesn't hear anything ! ..... mind you the stick only arrived this morning. One simple question ..... I set up the LAN address of my server and kept your port suggestion of 9999 and then I completed the wizard. The stick is reporting perfectly to the https://m.ginlong.com/ website. Now I reread your text instructions it maybe I have to reset and ignore the reporting to ginlong as perhaps the stick will only report to one or other of the defined servers and since its working with ginlong it doesn't send any data to the local server .... is this a correct assumption ? |
Hi David,
I have the second Ip pointing to me ubuntu VM port 5678 (random port)
[image: image.png]
#~/ginlong$ cat config.ini
[MQTT]
client_id = solis
mqtt_server = 192.168.X.XXX
mqtt_port = 1883
mqtt_username = 'USER'
mqtt_password = 'PASSWORD'
[DEFAULT]
listen_address = 0.0.0.0
listen_port = 5678
#header from solis.py
header = 1234567
…------------------------------------------------------------------------------------------------------
#~/ginlong$ cat solis.py
#!/usr/bin/env python
#===============================================================================
# Copyright (C) 2017 Darren Poulson
#
# This file is part of ginlong-mqtt.
#
# R2_Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# R2_Control is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import paho.mqtt.publish as publish
import socket
import binascii
import time
import sys
import string
import ConfigParser
import io
with open("config.ini") as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(io.BytesIO(sample_config))
rawlog = '/home/snash/ginlong/rawlog'
###########################
# Variables
listen_address = config.get('DEFAULT', 'listen_address') # What address
to listen to (0.0.0.0 means it will listen on all addresses)
listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
listen on
client_id = config.get('MQTT', 'client_id') # MQTT Client
ID
mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
Port
header = config.get('DEFAULT', 'header')
mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
Address
mqtt_password = config.get('MQTT', 'mqtt_password')
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((listen_address, listen_port))
sock.listen(1)
while True:
# Wait for a connection
if __debug__:
print 'waiting for a connection'
conn,addr = sock.accept()
try:
rawdata = conn.recv(1000) #
Read in a chunk of data
hexdata = binascii.hexlify(rawdata) #
Convert to hex for easier processing
if(len(hexdata) == 276):
timestamp = (time.strftime("%F %H:%M")) # get date
time
msgs = []
serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
number is used for MQTT path, allowing multiple inverters to connect to a
single instance
if __debug__:
print 'Hex data: %s' % hexdata
print 'Serial %s' % serial
print 'Length %s' % len(hexdata)
mqtt_topic = ''.join([client_id, "/", header, "/"]) #
Create the topic base using the client_id and serial number
if __debug__:
print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
##### dc_volts1
dc_volts1 = float(int(hexdata[66:70],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts1: ', dc_volts1
msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
##### dc_volts2
dc_volts2 = float(int(hexdata[70:74],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts2: ', dc_volts2
msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
##### dc_amps1
dc_amps1 = float(int(hexdata[78:82],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps1: ', dc_amps1
msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
##### dc_amps2
dc_amps2 = float(int(hexdata[82:86],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps2: ', dc_amps2
msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
##### ac_volts
ac_volts = float(int(hexdata[102:106],16))/10
if __debug__:
print >>sys.stderr, 'ac_volts: ', ac_volts
msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
##### ac_amps
ac_amps = float(int(hexdata[90:94],16))/10
if __debug__:
print >>sys.stderr, 'ac_amps: ', ac_amps
msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
##### watt now
watt_now = float(int(hexdata[118:122],16))/10
if __debug__:
print >>sys.stderr, 'watt_now: ', watt_now
msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
##### Fac
ac_freq = float(int(hexdata[114:118],16))/100
if __debug__:
print >>sys.stderr, 'ac_freq: ', ac_freq
msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
##### Temp
temp = float(int(hexdata[62:66],16))/10
if __debug__:
print >>sys.stderr, 'temp: ', temp
msgs.append((mqtt_topic + "temp", temp, 0, False))
##### kWh day
kwh_day = float(int(hexdata[138:142],16))/100
if __debug__:
print >>sys.stderr, 'kwh_day: ', kwh_day
msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
##### kWh total
kwh_total = float(int(hexdata[146:150],16))/10
if __debug__:
print >>sys.stderr, 'kwh_total: ', kwh_total
msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
##### kWh month
kwh_month = float(int(hexdata[174:178],16))/10
if __debug__:
print >>sys.stderr, 'kwh_month: ', kwh_month
msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
##### kWh last month
kwh_lastmonth = float(int(hexdata[182:186],16))/10
if __debug__:
print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
0, False))
publish.multiple(msgs, hostname=mqtt_server,
client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
file = open(rawlog,'a')
file.write(timestamp + ' ' + hexdata + '\n')
file.close()
finally:
if __debug__:
print "Finally"
-------------------------------------------------------------------
~/ginlong$ cat ginny-init
#! /bin/sh
### BEGIN INIT INFO
# Provides: ginlong-mqtt
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ginlong MQTT listener
# Description: Listens for connections from a ginlong solar inverter,
and pipes the output to MQTT
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
NAME=solis.py
DAEMON_PATH=/home/pi/ginlong
PIDFILE=/var/run/$NAME.pid
case "$1" in
start)
echo -n "Starting ginlong-mqtt: "
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
--background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null 2>&1
echo "done."
;;
stop)
echo -n "Stopping ginlong-mqtt: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm $PIDFILE
echo "done."
;;
restart)
echo "Restarting ginlong-mqtt: "
sh $0 stop
sleep 10
sh $0 start
;;
*)
echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
exit 1
;;
esac
exit 0
Python env install needed and mqtt-paho.
Regards,
Sean
On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.***> wrote:
Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have your
script running on a Raspi nearby. It is listening but doesn't hear anything
! ..... mind you the stick only arrived this morning. One simple question
..... I set up the LAN address of my server and kept your port suggestion
of 9999 and then I completed the wizard. The stick is reporting perfectly
to the https://m.ginlong.com/ website. Now I reread your text
instructions it maybe I have to reset and ignore the reporting to ginlong
as perhaps the stick will only report to one or other of the defined
servers and since its working with ginlong it doesn't send any data to the
local server .... is this a correct assumption ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
.
|
Hi Sean
Wow a quick response indeed …. Many thanks …..
I was just about to go and take the case off mine and reset it ….. and start again and make sure I did what I wanted to do in terms of local server address and port# ….
The main outstanding question for me is to those who have it working is ….. have you, at the same time, enabled the first IP to point to the to the ginseng website by completing the wizard ?
OR have you just enabled the 2nd IP and saved and reset the stick ?
I planned to look at your “decode” because you are on a 4G Solis invertor ….. and you’ve figured out some of the register addresses …… if/when I eventually untangle more then I’ll let you know for sure.
David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1745 776 126
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]>
From: flamegrilled <[email protected]>
Sent: 09 September 2020 16:37
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have the second Ip pointing to me ubuntu VM port 5678 (random port)
[image: image.png]
#~/ginlong$ cat config.ini
[MQTT]
client_id = solis
mqtt_server = 192.168.X.XXX
mqtt_port = 1883
mqtt_username = 'USER'
mqtt_password = 'PASSWORD'
[DEFAULT]
listen_address = 0.0.0.0
listen_port = 5678
#header from solis.py
header = 1234567
------------------------------------------------------------------------------------------------------
#~/ginlong$ cat solis.py
#!/usr/bin/env python
#===============================================================================
# Copyright (C) 2017 Darren Poulson
#
# This file is part of ginlong-mqtt.
#
# R2_Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# R2_Control is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import paho.mqtt.publish as publish
import socket
import binascii
import time
import sys
import string
import ConfigParser
import io
with open("config.ini") as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(io.BytesIO(sample_config))
rawlog = '/home/snash/ginlong/rawlog'
###########################
# Variables
listen_address = config.get('DEFAULT', 'listen_address') # What address
to listen to (0.0.0.0 means it will listen on all addresses)
listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
listen on
client_id = config.get('MQTT', 'client_id') # MQTT Client
ID
mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
Port
header = config.get('DEFAULT', 'header')
mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
Address
mqtt_password = config.get('MQTT', 'mqtt_password')
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((listen_address, listen_port))
sock.listen(1)
while True:
# Wait for a connection
if __debug__:
print 'waiting for a connection'
conn,addr = sock.accept()
try:
rawdata = conn.recv(1000) #
Read in a chunk of data
hexdata = binascii.hexlify(rawdata) #
Convert to hex for easier processing
if(len(hexdata) == 276):
timestamp = (time.strftime("%F %H:%M")) # get date
time
msgs = []
serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
number is used for MQTT path, allowing multiple inverters to connect to a
single instance
if __debug__:
print 'Hex data: %s' % hexdata
print 'Serial %s' % serial
print 'Length %s' % len(hexdata)
mqtt_topic = ''.join([client_id, "/", header, "/"]) #
Create the topic base using the client_id and serial number
if __debug__:
print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
##### dc_volts1
dc_volts1 = float(int(hexdata[66:70],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts1: ', dc_volts1
msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
##### dc_volts2
dc_volts2 = float(int(hexdata[70:74],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts2: ', dc_volts2
msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
##### dc_amps1
dc_amps1 = float(int(hexdata[78:82],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps1: ', dc_amps1
msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
##### dc_amps2
dc_amps2 = float(int(hexdata[82:86],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps2: ', dc_amps2
msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
##### ac_volts
ac_volts = float(int(hexdata[102:106],16))/10
if __debug__:
print >>sys.stderr, 'ac_volts: ', ac_volts
msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
##### ac_amps
ac_amps = float(int(hexdata[90:94],16))/10
if __debug__:
print >>sys.stderr, 'ac_amps: ', ac_amps
msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
##### watt now
watt_now = float(int(hexdata[118:122],16))/10
if __debug__:
print >>sys.stderr, 'watt_now: ', watt_now
msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
##### Fac
ac_freq = float(int(hexdata[114:118],16))/100
if __debug__:
print >>sys.stderr, 'ac_freq: ', ac_freq
msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
##### Temp
temp = float(int(hexdata[62:66],16))/10
if __debug__:
print >>sys.stderr, 'temp: ', temp
msgs.append((mqtt_topic + "temp", temp, 0, False))
##### kWh day
kwh_day = float(int(hexdata[138:142],16))/100
if __debug__:
print >>sys.stderr, 'kwh_day: ', kwh_day
msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
##### kWh total
kwh_total = float(int(hexdata[146:150],16))/10
if __debug__:
print >>sys.stderr, 'kwh_total: ', kwh_total
msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
##### kWh month
kwh_month = float(int(hexdata[174:178],16))/10
if __debug__:
print >>sys.stderr, 'kwh_month: ', kwh_month
msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
##### kWh last month
kwh_lastmonth = float(int(hexdata[182:186],16))/10
if __debug__:
print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
0, False))
publish.multiple(msgs, hostname=mqtt_server,
client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
file = open(rawlog,'a')
file.write(timestamp + ' ' + hexdata + '\n')
file.close()
finally:
if __debug__:
print "Finally"
-------------------------------------------------------------------
~/ginlong$ cat ginny-init
#! /bin/sh
### BEGIN INIT INFO
# Provides: ginlong-mqtt
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ginlong MQTT listener
# Description: Listens for connections from a ginlong solar inverter,
and pipes the output to MQTT
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
NAME=solis.py
DAEMON_PATH=/home/pi/ginlong
PIDFILE=/var/run/$NAME.pid
case "$1" in
start)
echo -n "Starting ginlong-mqtt: "
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
--background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null 2>&1
echo "done."
;;
stop)
echo -n "Stopping ginlong-mqtt: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm $PIDFILE
echo "done."
;;
restart)
echo "Restarting ginlong-mqtt: "
sh $0 stop
sleep 10
sh $0 start
;;
*)
echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
exit 1
;;
esac
exit 0
Python env install needed and mqtt-paho.
Regards,
Sean
On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.******@***.***>> wrote:
Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have your
script running on a Raspi nearby. It is listening but doesn't hear anything
! ..... mind you the stick only arrived this morning. One simple question
..... I set up the LAN address of my server and kept your port suggestion
of 9999 and then I completed the wizard. The stick is reporting perfectly
to the https://m.ginlong.com/ website. Now I reread your text
instructions it maybe I have to reset and ignore the reporting to ginlong
as perhaps the stick will only report to one or other of the defined
servers and since its working with ginlong it doesn't send any data to the
local server .... is this a correct assumption ?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXDIJIYIBLE2NWUU2ZTSE6OIBANCNFSM4EAHVYZQ>.
|
Hi David,
I have attached a picture of the setting. My first is set as "default" and
it still sends the info to ginlongmonitoring.com
Regards,
Sean
On Wed, Sep 9, 2020 at 5:43 PM davidbroster <[email protected]>
wrote:
… Hi Sean
Wow a quick response indeed …. Many thanks …..
I was just about to go and take the case off mine and reset it ….. and
start again and make sure I did what I wanted to do in terms of local
server address and port# ….
The main outstanding question for me is to those who have it working is
….. have you, at the same time, enabled the first IP to point to the to the
ginseng website by completing the wizard ?
OR have you just enabled the 2nd IP and saved and reset the stick ?
I planned to look at your “decode” because you are on a 4G Solis invertor
….. and you’ve figured out some of the register addresses …… if/when I
eventually untangle more then I’ll let you know for sure.
David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636)
***@***.***,0.762636
House: +44 (0)1745 776 126
Mobile David +44 (0)7557 359 095 ***@***.***<mailto:
***@***.***>
Mobile Margaret +44 (0)7557 359 417 ***@***.***<mailto:
***@***.***>
From: flamegrilled ***@***.***>
Sent: 09 September 2020 16:37
To: graham0/ginlong-wifi ***@***.***>
Cc: David Broster ***@***.***>; Comment ***@***.***>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have the second Ip pointing to me ubuntu VM port 5678 (random port)
[image: image.png]
#~/ginlong$ cat config.ini
[MQTT]
client_id = solis
mqtt_server = 192.168.X.XXX
mqtt_port = 1883
mqtt_username = 'USER'
mqtt_password = 'PASSWORD'
[DEFAULT]
listen_address = 0.0.0.0
listen_port = 5678
#header from solis.py
header = 1234567
------------------------------------------------------------------------------------------------------
#~/ginlong$ cat solis.py
#!/usr/bin/env python
#===============================================================================
# Copyright (C) 2017 Darren Poulson
#
# This file is part of ginlong-mqtt.
#
# R2_Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# R2_Control is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import paho.mqtt.publish as publish
import socket
import binascii
import time
import sys
import string
import ConfigParser
import io
with open("config.ini") as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(io.BytesIO(sample_config))
rawlog = '/home/snash/ginlong/rawlog'
###########################
# Variables
listen_address = config.get('DEFAULT', 'listen_address') # What address
to listen to (0.0.0.0 means it will listen on all addresses)
listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
listen on
client_id = config.get('MQTT', 'client_id') # MQTT Client
ID
mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
Port
header = config.get('DEFAULT', 'header')
mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
Address
mqtt_password = config.get('MQTT', 'mqtt_password')
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((listen_address, listen_port))
sock.listen(1)
while True:
# Wait for a connection
if __debug__:
print 'waiting for a connection'
conn,addr = sock.accept()
try:
rawdata = conn.recv(1000) #
Read in a chunk of data
hexdata = binascii.hexlify(rawdata) #
Convert to hex for easier processing
if(len(hexdata) == 276):
timestamp = (time.strftime("%F %H:%M")) # get date
time
msgs = []
serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
number is used for MQTT path, allowing multiple inverters to connect to a
single instance
if __debug__:
print 'Hex data: %s' % hexdata
print 'Serial %s' % serial
print 'Length %s' % len(hexdata)
mqtt_topic = ''.join([client_id, "/", header, "/"]) #
Create the topic base using the client_id and serial number
if __debug__:
print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
##### dc_volts1
dc_volts1 = float(int(hexdata[66:70],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts1: ', dc_volts1
msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
##### dc_volts2
dc_volts2 = float(int(hexdata[70:74],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts2: ', dc_volts2
msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
##### dc_amps1
dc_amps1 = float(int(hexdata[78:82],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps1: ', dc_amps1
msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
##### dc_amps2
dc_amps2 = float(int(hexdata[82:86],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps2: ', dc_amps2
msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
##### ac_volts
ac_volts = float(int(hexdata[102:106],16))/10
if __debug__:
print >>sys.stderr, 'ac_volts: ', ac_volts
msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
##### ac_amps
ac_amps = float(int(hexdata[90:94],16))/10
if __debug__:
print >>sys.stderr, 'ac_amps: ', ac_amps
msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
##### watt now
watt_now = float(int(hexdata[118:122],16))/10
if __debug__:
print >>sys.stderr, 'watt_now: ', watt_now
msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
##### Fac
ac_freq = float(int(hexdata[114:118],16))/100
if __debug__:
print >>sys.stderr, 'ac_freq: ', ac_freq
msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
##### Temp
temp = float(int(hexdata[62:66],16))/10
if __debug__:
print >>sys.stderr, 'temp: ', temp
msgs.append((mqtt_topic + "temp", temp, 0, False))
##### kWh day
kwh_day = float(int(hexdata[138:142],16))/100
if __debug__:
print >>sys.stderr, 'kwh_day: ', kwh_day
msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
##### kWh total
kwh_total = float(int(hexdata[146:150],16))/10
if __debug__:
print >>sys.stderr, 'kwh_total: ', kwh_total
msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
##### kWh month
kwh_month = float(int(hexdata[174:178],16))/10
if __debug__:
print >>sys.stderr, 'kwh_month: ', kwh_month
msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
##### kWh last month
kwh_lastmonth = float(int(hexdata[182:186],16))/10
if __debug__:
print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
0, False))
publish.multiple(msgs, hostname=mqtt_server,
client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
file = open(rawlog,'a')
file.write(timestamp + ' ' + hexdata + '\n')
file.close()
finally:
if __debug__:
print "Finally"
-------------------------------------------------------------------
~/ginlong$ cat ginny-init
#! /bin/sh
### BEGIN INIT INFO
# Provides: ginlong-mqtt
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ginlong MQTT listener
# Description: Listens for connections from a ginlong solar inverter,
and pipes the output to MQTT
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
NAME=solis.py
DAEMON_PATH=/home/pi/ginlong
PIDFILE=/var/run/$NAME.pid
case "$1" in
start)
echo -n "Starting ginlong-mqtt: "
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
--background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null 2>&1
echo "done."
;;
stop)
echo -n "Stopping ginlong-mqtt: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm $PIDFILE
echo "done."
;;
restart)
echo "Restarting ginlong-mqtt: "
sh $0 stop
sleep 10
sh $0 start
;;
*)
echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
exit 1
;;
esac
exit 0
Python env install needed and mqtt-paho.
Regards,
Sean
On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.***
***@***.***>>
wrote:
> Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have your
> script running on a Raspi nearby. It is listening but doesn't hear
anything
> ! ..... mind you the stick only arrived this morning. One simple
question
> ..... I set up the LAN address of my server and kept your port
suggestion
> of 9999 and then I completed the wizard. The stick is reporting
perfectly
> to the https://m.ginlong.com/ website. Now I reread your text
> instructions it maybe I have to reset and ignore the reporting to
ginlong
> as perhaps the stick will only report to one or other of the defined
> servers and since its working with ginlong it doesn't send any data to
the
> local server .... is this a correct assumption ?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#4 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/ACE5ZXDIJIYIBLE2NWUU2ZTSE6OIBANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDSUXG6CPNGRYYZGNYTSE6PCLANCNFSM4EAHVYZQ>
.
|
Hi Sean, good news that the Solis reports to both servers in your case …… by the way your picture attachment go blocked by my phone & tablet (Android) and laptop (Outlook on Win10)
I’ll go for the reset ….. and redo the settings …
David
From: flamegrilled <[email protected]>
Sent: 09 September 2020 16:50
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have attached a picture of the setting. My first is set as "default" and
it still sends the info to ginlongmonitoring.com
Regards,
Sean
On Wed, Sep 9, 2020 at 5:43 PM davidbroster <[email protected]<mailto:[email protected]>>
wrote:
Hi Sean
Wow a quick response indeed …. Many thanks …..
I was just about to go and take the case off mine and reset it ….. and
start again and make sure I did what I wanted to do in terms of local
server address and port# ….
The main outstanding question for me is to those who have it working is
….. have you, at the same time, enabled the first IP to point to the to the
ginseng website by completing the wizard ?
OR have you just enabled the 2nd IP and saved and reset the stick ?
I planned to look at your “decode” because you are on a 4G Solis invertor
….. and you’ve figured out some of the register addresses …… if/when I
eventually untangle more then I’ll let you know for sure.
David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636)
***@***.***,0.762636
House: +44 (0)1745 776 126
Mobile David +44 (0)7557 359 095 ***@***.******@***.***%3cmailto>:
***@***.******@***.***>>
Mobile Margaret +44 (0)7557 359 417 ***@***.******@***.***%3cmailto>:
***@***.******@***.***>>
From: flamegrilled ***@***.******@***.***>>
Sent: 09 September 2020 16:37
To: graham0/ginlong-wifi ***@***.******@***.***>>
Cc: David Broster ***@***.******@***.***>>; Comment ***@***.******@***.***>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have the second Ip pointing to me ubuntu VM port 5678 (random port)
[image: image.png]
#~/ginlong$ cat config.ini
[MQTT]
client_id = solis
mqtt_server = 192.168.X.XXX
mqtt_port = 1883
mqtt_username = 'USER'
mqtt_password = 'PASSWORD'
[DEFAULT]
listen_address = 0.0.0.0
listen_port = 5678
#header from solis.py
header = 1234567
------------------------------------------------------------------------------------------------------
#~/ginlong$ cat solis.py
#!/usr/bin/env python
#===============================================================================
# Copyright (C) 2017 Darren Poulson
#
# This file is part of ginlong-mqtt.
#
# R2_Control is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# R2_Control is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
import paho.mqtt.publish as publish
import socket
import binascii
import time
import sys
import string
import ConfigParser
import io
with open("config.ini") as f:
sample_config = f.read()
config = ConfigParser.RawConfigParser(allow_no_value=True)
config.readfp(io.BytesIO(sample_config))
rawlog = '/home/snash/ginlong/rawlog'
###########################
# Variables
listen_address = config.get('DEFAULT', 'listen_address') # What address
to listen to (0.0.0.0 means it will listen on all addresses)
listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
listen on
client_id = config.get('MQTT', 'client_id') # MQTT Client
ID
mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
Port
header = config.get('DEFAULT', 'header')
mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
Address
mqtt_password = config.get('MQTT', 'mqtt_password')
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((listen_address, listen_port))
sock.listen(1)
while True:
# Wait for a connection
if __debug__:
print 'waiting for a connection'
conn,addr = sock.accept()
try:
rawdata = conn.recv(1000) #
Read in a chunk of data
hexdata = binascii.hexlify(rawdata) #
Convert to hex for easier processing
if(len(hexdata) == 276):
timestamp = (time.strftime("%F %H:%M")) # get date
time
msgs = []
serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
number is used for MQTT path, allowing multiple inverters to connect to a
single instance
if __debug__:
print 'Hex data: %s' % hexdata
print 'Serial %s' % serial
print 'Length %s' % len(hexdata)
mqtt_topic = ''.join([client_id, "/", header, "/"]) #
Create the topic base using the client_id and serial number
if __debug__:
print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
##### dc_volts1
dc_volts1 = float(int(hexdata[66:70],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts1: ', dc_volts1
msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
##### dc_volts2
dc_volts2 = float(int(hexdata[70:74],16))/10
if __debug__:
print >>sys.stderr, 'dc_volts2: ', dc_volts2
msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
##### dc_amps1
dc_amps1 = float(int(hexdata[78:82],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps1: ', dc_amps1
msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
##### dc_amps2
dc_amps2 = float(int(hexdata[82:86],16))/10
if __debug__:
print >>sys.stderr, 'dc_amps2: ', dc_amps2
msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
##### ac_volts
ac_volts = float(int(hexdata[102:106],16))/10
if __debug__:
print >>sys.stderr, 'ac_volts: ', ac_volts
msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
##### ac_amps
ac_amps = float(int(hexdata[90:94],16))/10
if __debug__:
print >>sys.stderr, 'ac_amps: ', ac_amps
msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
##### watt now
watt_now = float(int(hexdata[118:122],16))/10
if __debug__:
print >>sys.stderr, 'watt_now: ', watt_now
msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
##### Fac
ac_freq = float(int(hexdata[114:118],16))/100
if __debug__:
print >>sys.stderr, 'ac_freq: ', ac_freq
msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
##### Temp
temp = float(int(hexdata[62:66],16))/10
if __debug__:
print >>sys.stderr, 'temp: ', temp
msgs.append((mqtt_topic + "temp", temp, 0, False))
##### kWh day
kwh_day = float(int(hexdata[138:142],16))/100
if __debug__:
print >>sys.stderr, 'kwh_day: ', kwh_day
msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
##### kWh total
kwh_total = float(int(hexdata[146:150],16))/10
if __debug__:
print >>sys.stderr, 'kwh_total: ', kwh_total
msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
##### kWh month
kwh_month = float(int(hexdata[174:178],16))/10
if __debug__:
print >>sys.stderr, 'kwh_month: ', kwh_month
msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
##### kWh last month
kwh_lastmonth = float(int(hexdata[182:186],16))/10
if __debug__:
print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
0, False))
publish.multiple(msgs, hostname=mqtt_server,
client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
file = open(rawlog,'a')
file.write(timestamp + ' ' + hexdata + '\n')
file.close()
finally:
if __debug__:
print "Finally"
-------------------------------------------------------------------
~/ginlong$ cat ginny-init
#! /bin/sh
### BEGIN INIT INFO
# Provides: ginlong-mqtt
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Ginlong MQTT listener
# Description: Listens for connections from a ginlong solar inverter,
and pipes the output to MQTT
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
NAME=solis.py
DAEMON_PATH=/home/pi/ginlong
PIDFILE=/var/run/$NAME.pid
case "$1" in
start)
echo -n "Starting ginlong-mqtt: "
start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
--background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null 2>&1
echo "done."
;;
stop)
echo -n "Stopping ginlong-mqtt: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE
rm $PIDFILE
echo "done."
;;
restart)
echo "Restarting ginlong-mqtt: "
sh $0 stop
sleep 10
sh $0 start
;;
*)
echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
exit 1
;;
esac
exit 0
Python env install needed and mqtt-paho.
Regards,
Sean
On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.***
<mailto:[email protected]%0b>> <mailto:[email protected]>>
wrote:
> Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have your
> script running on a Raspi nearby. It is listening but doesn't hear
anything
> ! ..... mind you the stick only arrived this morning. One simple
question
> ..... I set up the LAN address of my server and kept your port
suggestion
> of 9999 and then I completed the wizard. The stick is reporting
perfectly
> to the https://m.ginlong.com/ website. Now I reread your text
> instructions it maybe I have to reset and ignore the reporting to
ginlong
> as perhaps the stick will only report to one or other of the defined
> servers and since its working with ginlong it doesn't send any data to
the
> local server .... is this a correct assumption ?
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#4 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/ACE5ZXDIJIYIBLE2NWUU2ZTSE6OIBANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDSUXG6CPNGRYYZGNYTSE6PCLANCNFSM4EAHVYZQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXBVDNGOEP2EPHF3ZJ3SE6P3XANCNFSM4EAHVYZQ>.
|
https://drive.google.com/file/d/1deT3Nd6is5fp2D_xNDXNFhO_ZcM_Z52b/view?usp=sharing
On Wed, Sep 9, 2020 at 6:13 PM davidbroster <[email protected]>
wrote:
… Hi Sean, good news that the Solis reports to both servers in your case ……
by the way your picture attachment go blocked by my phone & tablet
(Android) and laptop (Outlook on Win10)
I’ll go for the reset ….. and redo the settings …
David
From: flamegrilled ***@***.***>
Sent: 09 September 2020 16:50
To: graham0/ginlong-wifi ***@***.***>
Cc: David Broster ***@***.***>; Comment ***@***.***>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have attached a picture of the setting. My first is set as "default" and
it still sends the info to ginlongmonitoring.com
Regards,
Sean
On Wed, Sep 9, 2020 at 5:43 PM davidbroster ***@***.***
***@***.***>>
wrote:
> Hi Sean
>
> Wow a quick response indeed …. Many thanks …..
>
> I was just about to go and take the case off mine and reset it ….. and
> start again and make sure I did what I wanted to do in terms of local
> server address and port# ….
>
> The main outstanding question for me is to those who have it working is
> ….. have you, at the same time, enabled the first IP to point to the to
the
> ginseng website by completing the wizard ?
> OR have you just enabled the 2nd IP and saved and reset the stick ?
>
> I planned to look at your “decode” because you are on a 4G Solis
invertor
> ….. and you’ve figured out some of the register addresses …… if/when I
> eventually untangle more then I’ll let you know for sure.
>
> David
>
>
> David & Margaret Broster
> “Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
> GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636)
> ***@***.***,0.762636
>
> House: +44 (0)1745 776 126
> Mobile David +44 (0)7557 359 095 ***@***.***<mailto<mailto:
***@***.***%3cmailto>:
> ***@***.******@***.***>>
> Mobile Margaret +44 (0)7557 359 417 ***@***.***<mailto<mailto:
***@***.***%3cmailto>:
> ***@***.******@***.***>>
>
>
>
> From: flamegrilled ***@***.***<mailto:
***@***.***>>
> Sent: 09 September 2020 16:37
> To: graham0/ginlong-wifi ***@***.***<mailto:
***@***.***>>
> Cc: David Broster ***@***.******@***.***>>;
Comment ***@***.******@***.***>>
>
> Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
>
> Hi David,
>
> I have the second Ip pointing to me ubuntu VM port 5678 (random port)
>
> [image: image.png]
> #~/ginlong$ cat config.ini
> [MQTT]
> client_id = solis
> mqtt_server = 192.168.X.XXX
> mqtt_port = 1883
> mqtt_username = 'USER'
> mqtt_password = 'PASSWORD'
>
> [DEFAULT]
> listen_address = 0.0.0.0
> listen_port = 5678
> #header from solis.py
> header = 1234567
>
>
------------------------------------------------------------------------------------------------------
>
>
>
> #~/ginlong$ cat solis.py
> #!/usr/bin/env python
>
#===============================================================================
>
> # Copyright (C) 2017 Darren Poulson
> #
> # This file is part of ginlong-mqtt.
> #
> # R2_Control is free software: you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> # the Free Software Foundation, either version 3 of the License, or
> # (at your option) any later version.
> #
> # R2_Control is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> # GNU General Public License for more details.
> #
> # You should have received a copy of the GNU General Public License
> # along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
>
#===============================================================================
>
>
>
> import paho.mqtt.publish as publish
> import socket
> import binascii
> import time
> import sys
> import string
> import ConfigParser
> import io
>
> with open("config.ini") as f:
> sample_config = f.read()
> config = ConfigParser.RawConfigParser(allow_no_value=True)
> config.readfp(io.BytesIO(sample_config))
> rawlog = '/home/snash/ginlong/rawlog'
> ###########################
> # Variables
>
> listen_address = config.get('DEFAULT', 'listen_address') # What address
> to listen to (0.0.0.0 means it will listen on all addresses)
> listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
> listen on
> client_id = config.get('MQTT', 'client_id') # MQTT Client
> ID
> mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
> mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
> Port
> header = config.get('DEFAULT', 'header')
> mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
> Address
> mqtt_password = config.get('MQTT', 'mqtt_password')
>
> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> sock.bind((listen_address, listen_port))
> sock.listen(1)
>
> while True:
> # Wait for a connection
> if __debug__:
> print 'waiting for a connection'
> conn,addr = sock.accept()
> try:
> rawdata = conn.recv(1000) #
> Read in a chunk of data
> hexdata = binascii.hexlify(rawdata) #
> Convert to hex for easier processing
>
> if(len(hexdata) == 276):
> timestamp = (time.strftime("%F %H:%M")) # get date
> time
> msgs = []
> serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
> number is used for MQTT path, allowing multiple inverters to connect to
a
> single instance
> if __debug__:
> print 'Hex data: %s' % hexdata
> print 'Serial %s' % serial
> print 'Length %s' % len(hexdata)
> mqtt_topic = ''.join([client_id, "/", header, "/"]) #
> Create the topic base using the client_id and serial number
> if __debug__:
> print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
>
> ##### dc_volts1
> dc_volts1 = float(int(hexdata[66:70],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_volts1: ', dc_volts1
> msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
>
> ##### dc_volts2
> dc_volts2 = float(int(hexdata[70:74],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_volts2: ', dc_volts2
> msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
>
> ##### dc_amps1
> dc_amps1 = float(int(hexdata[78:82],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_amps1: ', dc_amps1
> msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
>
> ##### dc_amps2
> dc_amps2 = float(int(hexdata[82:86],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_amps2: ', dc_amps2
> msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
>
> ##### ac_volts
> ac_volts = float(int(hexdata[102:106],16))/10
> if __debug__:
> print >>sys.stderr, 'ac_volts: ', ac_volts
> msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
>
> ##### ac_amps
> ac_amps = float(int(hexdata[90:94],16))/10
> if __debug__:
> print >>sys.stderr, 'ac_amps: ', ac_amps
> msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
>
> ##### watt now
> watt_now = float(int(hexdata[118:122],16))/10
> if __debug__:
> print >>sys.stderr, 'watt_now: ', watt_now
> msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
>
> ##### Fac
> ac_freq = float(int(hexdata[114:118],16))/100
> if __debug__:
> print >>sys.stderr, 'ac_freq: ', ac_freq
> msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
>
> ##### Temp
> temp = float(int(hexdata[62:66],16))/10
> if __debug__:
> print >>sys.stderr, 'temp: ', temp
> msgs.append((mqtt_topic + "temp", temp, 0, False))
>
> ##### kWh day
> kwh_day = float(int(hexdata[138:142],16))/100
> if __debug__:
> print >>sys.stderr, 'kwh_day: ', kwh_day
> msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
>
> ##### kWh total
> kwh_total = float(int(hexdata[146:150],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_total: ', kwh_total
> msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
>
> ##### kWh month
> kwh_month = float(int(hexdata[174:178],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_month: ', kwh_month
> msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
>
> ##### kWh last month
> kwh_lastmonth = float(int(hexdata[182:186],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
> msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
> 0, False))
>
> publish.multiple(msgs, hostname=mqtt_server,
> client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
> file = open(rawlog,'a')
> file.write(timestamp + ' ' + hexdata + '\n')
> file.close()
>
> finally:
> if __debug__:
> print "Finally"
> -------------------------------------------------------------------
>
> ~/ginlong$ cat ginny-init
>
> #! /bin/sh
> ### BEGIN INIT INFO
> # Provides: ginlong-mqtt
> # Required-Start:
> # Required-Stop:
> # Default-Start: 2 3 4 5
> # Default-Stop: 0 1 6
> # Short-Description: Ginlong MQTT listener
> # Description: Listens for connections from a ginlong solar inverter,
> and pipes the output to MQTT
> ### END INIT INFO
>
> PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
> NAME=solis.py
> DAEMON_PATH=/home/pi/ginlong
> PIDFILE=/var/run/$NAME.pid
>
> case "$1" in
> start)
> echo -n "Starting ginlong-mqtt: "
> start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
> --background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null
2>&1
> echo "done."
> ;;
> stop)
> echo -n "Stopping ginlong-mqtt: "
> start-stop-daemon --stop --quiet --pidfile $PIDFILE
> rm $PIDFILE
> echo "done."
> ;;
> restart)
> echo "Restarting ginlong-mqtt: "
> sh $0 stop
> sleep 10
> sh $0 start
> ;;
> *)
> echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
> exit 1
> ;;
> esac
> exit 0
>
>
>
> Python env install needed and mqtt-paho.
>
> Regards,
>
> Sean
>
>
> On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.***
***@***.***%0b>> ***@***.***>>
> wrote:
>
> > Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have
your
> > script running on a Raspi nearby. It is listening but doesn't hear
> anything
> > ! ..... mind you the stick only arrived this morning. One simple
> question
> > ..... I set up the LAN address of my server and kept your port
> suggestion
> > of 9999 and then I completed the wizard. The stick is reporting
> perfectly
> > to the https://m.ginlong.com/ website. Now I reread your text
> > instructions it maybe I have to reset and ignore the reporting to
> ginlong
> > as perhaps the stick will only report to one or other of the defined
> > servers and since its working with ginlong it doesn't send any data to
> the
> > local server .... is this a correct assumption ?
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <
#4 (comment)>,
>
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
>
> > .
> >
>
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub<
> #4 (comment)>,
> or unsubscribe<
>
https://github.com/notifications/unsubscribe-auth/ACE5ZXDIJIYIBLE2NWUU2ZTSE6OIBANCNFSM4EAHVYZQ>.
>
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AN6RDDSUXG6CPNGRYYZGNYTSE6PCLANCNFSM4EAHVYZQ>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#4 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/ACE5ZXBVDNGOEP2EPHF3ZJ3SE6P3XANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDSSW23TJRNQQNXPTNTSE6SQ7ANCNFSM4EAHVYZQ>
.
|
Hi Sean, perfect and exactly what I did in effect ….. so I’ll “re-do” and then I’ll investigate by making my own socket sender and send some messages to my server to see what happens.
More later …..
D
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1745 776 126
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]>
From: flamegrilled <[email protected]>
Sent: 09 September 2020 17:55
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
https://drive.google.com/file/d/1deT3Nd6is5fp2D_xNDXNFhO_ZcM_Z52b/view?usp=sharing
On Wed, Sep 9, 2020 at 6:13 PM davidbroster <[email protected]<mailto:[email protected]>>
wrote:
Hi Sean, good news that the Solis reports to both servers in your case ……
by the way your picture attachment go blocked by my phone & tablet
(Android) and laptop (Outlook on Win10)
I’ll go for the reset ….. and redo the settings …
David
From: flamegrilled ***@***.******@***.***>>
Sent: 09 September 2020 16:50
To: graham0/ginlong-wifi ***@***.******@***.***>>
Cc: David Broster ***@***.******@***.***>>; Comment ***@***.******@***.***>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi David,
I have attached a picture of the setting. My first is set as "default" and
it still sends the info to ginlongmonitoring.com
Regards,
Sean
On Wed, Sep 9, 2020 at 5:43 PM davidbroster ***@***.***
<mailto:[email protected]%0b>> <mailto:[email protected]>>
wrote:
> Hi Sean
>
> Wow a quick response indeed …. Many thanks …..
>
> I was just about to go and take the case off mine and reset it ….. and
> start again and make sure I did what I wanted to do in terms of local
> server address and port# ….
>
> The main outstanding question for me is to those who have it working is
> ….. have you, at the same time, enabled the first IP to point to the to
the
> ginseng website by completing the wizard ?
> OR have you just enabled the 2nd IP and saved and reset the stick ?
>
> I planned to look at your “decode” because you are on a 4G Solis
invertor
> ….. and you’ve figured out some of the register addresses …… if/when I
> eventually untangle more then I’ll let you know for sure.
>
> David
>
>
> David & Margaret Broster
> “Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
> GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636)
> ***@***.***,0.762636
>
> House: +44 (0)1745 776 126
> Mobile David +44 (0)7557 359 095 ***@***.******@***.***%3cmailto%3cmailto>:
***@***.******@***.***%3cmailto>>:
> ***@***.******@***.******@***.******@***.***>>>
> Mobile Margaret +44 (0)7557 359 417 ***@***.******@***.***%3cmailto%3cmailto>:
***@***.******@***.***%3cmailto>>:
> ***@***.******@***.******@***.******@***.***>>>
>
>
>
> From: flamegrilled ***@***.***<mailto:
> Sent: 09 September 2020 16:37
> To: graham0/ginlong-wifi ***@***.***<mailto:
> Cc: David Broster ***@***.******@***.******@***.******@***.***>>>;
Comment ***@***.******@***.******@***.******@***.***>>>
>
> Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
>
> Hi David,
>
> I have the second Ip pointing to me ubuntu VM port 5678 (random port)
>
> [image: image.png]
> #~/ginlong$ cat config.ini
> [MQTT]
> client_id = solis
> mqtt_server = 192.168.X.XXX
> mqtt_port = 1883
> mqtt_username = 'USER'
> mqtt_password = 'PASSWORD'
>
> [DEFAULT]
> listen_address = 0.0.0.0
> listen_port = 5678
> #header from solis.py
> header = 1234567
>
>
------------------------------------------------------------------------------------------------------
>
>
>
> #~/ginlong$ cat solis.py
> #!/usr/bin/env python
>
#===============================================================================
>
> # Copyright (C) 2017 Darren Poulson
> #
> # This file is part of ginlong-mqtt.
> #
> # R2_Control is free software: you can redistribute it and/or modify
> # it under the terms of the GNU General Public License as published by
> # the Free Software Foundation, either version 3 of the License, or
> # (at your option) any later version.
> #
> # R2_Control is distributed in the hope that it will be useful,
> # but WITHOUT ANY WARRANTY; without even the implied warranty of
> # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> # GNU General Public License for more details.
> #
> # You should have received a copy of the GNU General Public License
> # along with ginlong-mqtt. If not, see <http://www.gnu.org/licenses/>.
>
#===============================================================================
>
>
>
> import paho.mqtt.publish as publish
> import socket
> import binascii
> import time
> import sys
> import string
> import ConfigParser
> import io
>
> with open("config.ini") as f:
> sample_config = f.read()
> config = ConfigParser.RawConfigParser(allow_no_value=True)
> config.readfp(io.BytesIO(sample_config))
> rawlog = '/home/snash/ginlong/rawlog'
> ###########################
> # Variables
>
> listen_address = config.get('DEFAULT', 'listen_address') # What address
> to listen to (0.0.0.0 means it will listen on all addresses)
> listen_port = int(config.get('DEFAULT', 'listen_port')) # Port to
> listen on
> client_id = config.get('MQTT', 'client_id') # MQTT Client
> ID
> mqtt_server = config.get('MQTT', 'mqtt_server') # MQTT Address
> mqtt_port = int(config.get('MQTT', 'mqtt_port')) # MQTT
> Port
> header = config.get('DEFAULT', 'header')
> mqtt_username = config.get('MQTT', 'mqtt_username') # MQTT
> Address
> mqtt_password = config.get('MQTT', 'mqtt_password')
>
> sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
> sock.bind((listen_address, listen_port))
> sock.listen(1)
>
> while True:
> # Wait for a connection
> if __debug__:
> print 'waiting for a connection'
> conn,addr = sock.accept()
> try:
> rawdata = conn.recv(1000) #
> Read in a chunk of data
> hexdata = binascii.hexlify(rawdata) #
> Convert to hex for easier processing
>
> if(len(hexdata) == 276):
> timestamp = (time.strftime("%F %H:%M")) # get date
> time
> msgs = []
> serial = binascii.unhexlify(str(hexdata[0:8])) # Serial
> number is used for MQTT path, allowing multiple inverters to connect to
a
> single instance
> if __debug__:
> print 'Hex data: %s' % hexdata
> print 'Serial %s' % serial
> print 'Length %s' % len(hexdata)
> mqtt_topic = ''.join([client_id, "/", header, "/"]) #
> Create the topic base using the client_id and serial number
> if __debug__:
> print >>sys.stderr, 'MQTT Topic: ', mqtt_topic
>
> ##### dc_volts1
> dc_volts1 = float(int(hexdata[66:70],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_volts1: ', dc_volts1
> msgs.append((mqtt_topic + "dc_volts1", dc_volts1, 0, False))
>
> ##### dc_volts2
> dc_volts2 = float(int(hexdata[70:74],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_volts2: ', dc_volts2
> msgs.append((mqtt_topic + "dc_volts2", dc_volts2, 0, False))
>
> ##### dc_amps1
> dc_amps1 = float(int(hexdata[78:82],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_amps1: ', dc_amps1
> msgs.append((mqtt_topic + "dc_amps1", dc_amps1, 0, False))
>
> ##### dc_amps2
> dc_amps2 = float(int(hexdata[82:86],16))/10
> if __debug__:
> print >>sys.stderr, 'dc_amps2: ', dc_amps2
> msgs.append((mqtt_topic + "dc_amps2", dc_amps2, 0, False))
>
> ##### ac_volts
> ac_volts = float(int(hexdata[102:106],16))/10
> if __debug__:
> print >>sys.stderr, 'ac_volts: ', ac_volts
> msgs.append((mqtt_topic + "ac_volts", ac_volts, 0, False))
>
> ##### ac_amps
> ac_amps = float(int(hexdata[90:94],16))/10
> if __debug__:
> print >>sys.stderr, 'ac_amps: ', ac_amps
> msgs.append((mqtt_topic + "ac_amps", ac_amps, 0, False))
>
> ##### watt now
> watt_now = float(int(hexdata[118:122],16))/10
> if __debug__:
> print >>sys.stderr, 'watt_now: ', watt_now
> msgs.append((mqtt_topic + "watt_now", watt_now, 0, False))
>
> ##### Fac
> ac_freq = float(int(hexdata[114:118],16))/100
> if __debug__:
> print >>sys.stderr, 'ac_freq: ', ac_freq
> msgs.append((mqtt_topic + "ac_freq", ac_freq, 0, False))
>
> ##### Temp
> temp = float(int(hexdata[62:66],16))/10
> if __debug__:
> print >>sys.stderr, 'temp: ', temp
> msgs.append((mqtt_topic + "temp", temp, 0, False))
>
> ##### kWh day
> kwh_day = float(int(hexdata[138:142],16))/100
> if __debug__:
> print >>sys.stderr, 'kwh_day: ', kwh_day
> msgs.append((mqtt_topic + "kwh_day", kwh_day, 0, False))
>
> ##### kWh total
> kwh_total = float(int(hexdata[146:150],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_total: ', kwh_total
> msgs.append((mqtt_topic + "kwh_total", kwh_total, 0, False))
>
> ##### kWh month
> kwh_month = float(int(hexdata[174:178],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_month: ', kwh_month
> msgs.append((mqtt_topic + "kwh_month", kwh_month, 0, False))
>
> ##### kWh last month
> kwh_lastmonth = float(int(hexdata[182:186],16))/10
> if __debug__:
> print >>sys.stderr, 'kwh_lastmonth: ', kwh_lastmonth
> msgs.append((mqtt_topic + "kwh_lastmonth", kwh_lastmonth,
> 0, False))
>
> publish.multiple(msgs, hostname=mqtt_server,
> client_id="solis", auth = {'username':"USER", 'password':"PASSWORD"})
> file = open(rawlog,'a')
> file.write(timestamp + ' ' + hexdata + '\n')
> file.close()
>
> finally:
> if __debug__:
> print "Finally"
> -------------------------------------------------------------------
>
> ~/ginlong$ cat ginny-init
>
> #! /bin/sh
> ### BEGIN INIT INFO
> # Provides: ginlong-mqtt
> # Required-Start:
> # Required-Stop:
> # Default-Start: 2 3 4 5
> # Default-Stop: 0 1 6
> # Short-Description: Ginlong MQTT listener
> # Description: Listens for connections from a ginlong solar inverter,
> and pipes the output to MQTT
> ### END INIT INFO
>
> PATH=/bin:/usr/bin:/sbin:/usr/sbin:/home/pi/ginlong
> NAME=solis.py
> DAEMON_PATH=/home/pi/ginlong
> PIDFILE=/var/run/$NAME.pid
>
> case "$1" in
> start)
> echo -n "Starting ginlong-mqtt: "
> start-stop-daemon --start --pidfile $PIDFILE --make-pidfile
> --background --no-close --chdir $DAEMON_PATH --exec $NAME > /dev/null
2>&1
> echo "done."
> ;;
> stop)
> echo -n "Stopping ginlong-mqtt: "
> start-stop-daemon --stop --quiet --pidfile $PIDFILE
> rm $PIDFILE
> echo "done."
> ;;
> restart)
> echo "Restarting ginlong-mqtt: "
> sh $0 stop
> sleep 10
> sh $0 start
> ;;
> *)
> echo "Usage: /home/pi/ginlong/solis.py {start|stop|restart|save}"
> exit 1
> ;;
> esac
> exit 0
>
>
>
> Python env install needed and mqtt-paho.
>
> Regards,
>
> Sean
>
>
> On Wed, Sep 9, 2020 at 5:04 PM davidbroster ***@***.***
> wrote:
>
> > Hi Graham, I've just set up a Wifi stick on my Solis 3.6 4G. I have
your
> > script running on a Raspi nearby. It is listening but doesn't hear
> anything
> > ! ..... mind you the stick only arrived this morning. One simple
> question
> > ..... I set up the LAN address of my server and kept your port
> suggestion
> > of 9999 and then I completed the wizard. The stick is reporting
> perfectly
> > to the https://m.ginlong.com/ website. Now I reread your text
> > instructions it maybe I have to reset and ignore the reporting to
> ginlong
> > as perhaps the stick will only report to one or other of the defined
> > servers and since its working with ginlong it doesn't send any data to
> the
> > local server .... is this a correct assumption ?
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <
#4 (comment)>,
>
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/AN6RDDVSBKA22VRSY5MJB33SE6KRBANCNFSM4EAHVYZQ>
>
> > .
> >
>
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub<
> #4 (comment)>,
> or unsubscribe<
>
https://github.com/notifications/unsubscribe-auth/ACE5ZXDIJIYIBLE2NWUU2ZTSE6OIBANCNFSM4EAHVYZQ>.
>
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/AN6RDDSUXG6CPNGRYYZGNYTSE6PCLANCNFSM4EAHVYZQ>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<
#4 (comment)>,
or unsubscribe<
https://github.com/notifications/unsubscribe-auth/ACE5ZXBVDNGOEP2EPHF3ZJ3SE6P3XANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN6RDDSSW23TJRNQQNXPTNTSE6SQ7ANCNFSM4EAHVYZQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXAAJZZKDVEB73QHY4DSE6XNBANCNFSM4EAHVYZQ>.
|
Hey Guys, Just got my Solis installed and running today in Sydney - they are currently shutdown as it is night. In terms of getting the output to the two servers
Craig |
Hi Craig,
Until now I’ve had absolutely no success receiving anything from the wifi stick and my network sniffer doesn’t spot the stick sending data to the ginlong website – but it does 😊
I reached the config_hide page and set the 2nd server to point to my socket receiver on (192.168.1.210 port 9999) but nothing arrives.
After setting the second server setting I then went to the normal start-up page of the stick and ran quickly through the wizard so the stick could connect to my wifi ….. then it restart and
Started to send data to the ginlong website but nothing to me ….. I wonder now if I should simply ignore their website and set all the addresses to point to my server which is sitting “listening”.
You said that “when i configured the address in this new webpage i can see it attaching to my Ubuntu VM" …. Can you explain what you did after “configuring the address” ?
Many thanks in advance ……. David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1284 788 255
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]>
From: craigcurtin-dev <[email protected]>
Sent: 17 September 2020 10:29
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hey Guys,
Just got my Solis installed and running today in Sydney - they are currently shutdown as it is night.
In terms of getting the output to the two servers
1. It only outputs every 5 minutes if you have it in TCP Client mode
2. If you go to the URL http:\YOUR_INVERTER_IP\config_hide.html you can get at the extra settings you need (from what i have found so far
3. When i add a 2nd Server - as you have noted no data was coming out - when i configured the address in this new webpage i can see it attaching to my Ubuntu VM
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXC2P5IAQORJ32TGNATSGHJHLANCNFSM4EAHVYZQ>.
|
David,
In the new screen that I found – I changed the setting to be TCP Client and the port that I was interested in (when it was set as TCP server I could not change the IP address – it was greeyd out and was set to their default startup IP address.)
I then ran the Listener Python script from here
https://github.com/XtheOne/Inverter-Data-Logger/
And could see the Inverter attaching to the listener
My inverters then went to sleep for the end of the day – so I will continue experimenting tomorrow and report back
Craig
From: davidbroster <[email protected]>
Sent: Friday, September 18, 2020 3:11 AM
To: graham0/ginlong-wifi <[email protected]>
Cc: Craig Curtin <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi Craig,
Until now I’ve had absolutely no success receiving anything from the wifi stick and my network sniffer doesn’t spot the stick sending data to the ginlong website – but it does 😊
I reached the config_hide page and set the 2nd server to point to my socket receiver on (192.168.1.210 port 9999) but nothing arrives.
After setting the second server setting I then went to the normal start-up page of the stick and ran quickly through the wizard so the stick could connect to my wifi ….. then it restart and
Started to send data to the ginlong website but nothing to me ….. I wonder now if I should simply ignore their website and set all the addresses to point to my server which is sitting “listening”.
You said that “when i configured the address in this new webpage i can see it attaching to my Ubuntu VM" …. Can you explain what you did after “configuring the address” ?
Many thanks in advance ……. David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1284 788 255
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
From: craigcurtin-dev <[email protected]<mailto:[email protected]>>
Sent: 17 September 2020 10:29
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]>>
Cc: David Broster <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hey Guys,
Just got my Solis installed and running today in Sydney - they are currently shutdown as it is night.
In terms of getting the output to the two servers
1. It only outputs every 5 minutes if you have it in TCP Client mode
2. If you go to the URL http:\YOUR_INVERTER_IP\config_hide.html you can get at the extra settings you need (from what i have found so far
3. When i add a 2nd Server - as you have noted no data was coming out - when i configured the address in this new webpage i can see it attaching to my Ubuntu VM
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXC2P5IAQORJ32TGNATSGHJHLANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST2UD7LHPYASGI2WQKTSGI7L5ANCNFSM4EAHVYZQ>.
|
Craig, many thanks ….. indeed my invertor goes to sleep when I’m most active. I’ll also try again and report back
David
From: craigcurtin-dev <[email protected]>
Sent: 17 September 2020 19:46
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
David,
In the new screen that I found – I changed the setting to be TCP Client and the port that I was interested in (when it was set as TCP server I could not change the IP address – it was greeyd out and was set to their default startup IP address.)
I then ran the Listener Python script from here
https://github.com/XtheOne/Inverter-Data-Logger/
And could see the Inverter attaching to the listener
My inverters then went to sleep for the end of the day – so I will continue experimenting tomorrow and report back
Craig
From: davidbroster <[email protected]<mailto:[email protected]>>
Sent: Friday, September 18, 2020 3:11 AM
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]>>
Cc: Craig Curtin <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi Craig,
Until now I’ve had absolutely no success receiving anything from the wifi stick and my network sniffer doesn’t spot the stick sending data to the ginlong website – but it does 😊
I reached the config_hide page and set the 2nd server to point to my socket receiver on (192.168.1.210 port 9999) but nothing arrives.
After setting the second server setting I then went to the normal start-up page of the stick and ran quickly through the wizard so the stick could connect to my wifi ….. then it restart and
Started to send data to the ginlong website but nothing to me ….. I wonder now if I should simply ignore their website and set all the addresses to point to my server which is sitting “listening”.
You said that “when i configured the address in this new webpage i can see it attaching to my Ubuntu VM" …. Can you explain what you did after “configuring the address” ?
Many thanks in advance ……. David
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1284 788 255
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>
From: craigcurtin-dev <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Sent: 17 September 2020 10:29
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Cc: David Broster <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>; Comment <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hey Guys,
Just got my Solis installed and running today in Sydney - they are currently shutdown as it is night.
In terms of getting the output to the two servers
1. It only outputs every 5 minutes if you have it in TCP Client mode
2. If you go to the URL http:\YOUR_INVERTER_IP\config_hide.html you can get at the extra settings you need (from what i have found so far
3. When i add a 2nd Server - as you have noted no data was coming out - when i configured the address in this new webpage i can see it attaching to my Ubuntu VM
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXC2P5IAQORJ32TGNATSGHJHLANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST2UD7LHPYASGI2WQKTSGI7L5ANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXHRT2IZ642Q5LWCO4DSGJKOHANCNFSM4EAHVYZQ>.
|
OK more updates on my progress or lack thereof. The WIFI sticks (as probably everyone knows already) are made by IGEN/Solarman. The Solis/Ginlong website is just a rebranded version of their system. It appears to be random but the majority of new sticks are now using the V5 protocol when sending data to Ginlong. They also appear to totally ignore the 2nd server setting and never send anything out. For future reference the Solis 3P5K-4G inverter that i have (i have two of them) has a single RS485 bus that is exposed to us - when using the WIFI dongle it is plugged into that RS485 bus and will only work with the inverter set to address 1. So having multiple inverters means there is no way to have two of them on the same RS485 bus. Igate also make a WIFI box for the situation where you may have multiple inverters - it is marketed by Solis as the DLB (Data Logging Box) - here in Australia it sells for $350 ex gst and then you have to buy a wiring loom for it - RJ45 on the DLB end and RS485 Circular 4 pin connector - which is an ExceedCon unit and is extremely hard to source - still looking for that seperately. I intend to ditch the WIFI stick and move to RS485 between the inverters and my monitoring system Craig |
I’ve been away from my hobby desk after back-surgery, but now I’m starting to (re)get up to speed by sniffing my network and nothing is being sent to the 2nd server here either. My stick has “402” designation so I’m going to try the intercept of the main server code that was posted for 402 sticks (https://github.com/t3kpunk/Omniksol-PV-Logger). I’ll report back
David
From: craigcurtin-dev <[email protected]>
Sent: 05 October 2020 08:47
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
OK more updates on my progress or lack thereof.
The WIFI sticks (as probably everyone knows already) are made by IGEN/Solarman. The Solis/Ginlong website is just a rebranded version of their system.
It appears to be random but the majority of new sticks are now using the V5 protocol when sending data to Ginlong. They also appear to totally ignore the 2nd server setting and never send anything out.
For future reference the Solis 3P5K-4G inverter that i have (i have two of them) has a single RS485 bus that is exposed to us - when using the WIFI dongle it is plugged into that RS485 bus and will only work with the inverter set to address 1.
So having multiple inverters means there is no way to have two of them on the same RS485 bus.
Igate also make a WIFI box for the situation where you may have multiple inverters - it is marketed by Solis as the DLB (Data Logging Box) - here in Australia it sells for $350 ex gst and then you have to buy a wiring loom for it - RJ45 on the DLB end and RS485 Circular 4 pin connector - which is an ExceedCon unit and is extremely hard to source - still looking for that seperately.
I intend to ditch the WIFI stick and move to RS485 between the inverters and my monitoring system
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXG23BH35RBGP6534ITSJF2YVANCNFSM4EAHVYZQ>.
|
David,
I have just started messing around with a docker image that I found online that scrapes the data from the Solarman/Solis/Ginlong site.
It looks promising – I just have to adapt it for my 3 phase units and might use that as the interim step
Here is the link if you are interested – takes no time to spin up the docker image
https://hub.docker.com/r/fredericvl/ginlong-solis-scraper
Craig
From: davidbroster <[email protected]>
Sent: Tuesday, October 6, 2020 4:23 AM
To: graham0/ginlong-wifi <[email protected]>
Cc: Craig Curtin <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
I’ve been away from my hobby desk after back-surgery, but now I’m starting to (re)get up to speed by sniffing my network and nothing is being sent to the 2nd server here either. My stick has “402” designation so I’m going to try the intercept of the main server code that was posted for 402 sticks (https://github.com/t3kpunk/Omniksol-PV-Logger). I’ll report back
David
From: craigcurtin-dev <[email protected]<mailto:[email protected]>>
Sent: 05 October 2020 08:47
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]>>
Cc: David Broster <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
OK more updates on my progress or lack thereof.
The WIFI sticks (as probably everyone knows already) are made by IGEN/Solarman. The Solis/Ginlong website is just a rebranded version of their system.
It appears to be random but the majority of new sticks are now using the V5 protocol when sending data to Ginlong. They also appear to totally ignore the 2nd server setting and never send anything out.
For future reference the Solis 3P5K-4G inverter that i have (i have two of them) has a single RS485 bus that is exposed to us - when using the WIFI dongle it is plugged into that RS485 bus and will only work with the inverter set to address 1.
So having multiple inverters means there is no way to have two of them on the same RS485 bus.
Igate also make a WIFI box for the situation where you may have multiple inverters - it is marketed by Solis as the DLB (Data Logging Box) - here in Australia it sells for $350 ex gst and then you have to buy a wiring loom for it - RJ45 on the DLB end and RS485 Circular 4 pin connector - which is an ExceedCon unit and is extremely hard to source - still looking for that seperately.
I intend to ditch the WIFI stick and move to RS485 between the inverters and my monitoring system
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXG23BH35RBGP6534ITSJF2YVANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST2UAKO36T5URLQ7GLTSJH6GPANCNFSM4EAHVYZQ>.
|
Hi Craig,
I “gave up” on the scraping and redirecting route and decided to “hack” my ‘402’ stick by adding a ‘Raspberry Pi Zero W’ and USB-RS485 adapter (yes it will all fit inside the original stick !!!). So I retain the Ginlong wifi-stick website reporting and added my own private data-grab. A little bit of Python3 to send modbus group 4 register reads to the Solis …. which are then decoded and shipped as serialised (pickled) through a python LAN socket to my hot water tank immersion heater controller (another RasPi Zero W). Low cost, low effort and It works really well grabbing updates every minute. The tank side ‘listens’ 24/7 and of course the Solis side shuts down overnight, which upset the tank-side watchdog so I’m currently rewriting some of the tank-side code to accommodate and at the same time producing some hourly ‘matplotlib’ graphics. I’m happy with this solution and will share if you are interested. Let me know.
RSVP ……… David
From: craigcurtin-dev <[email protected]>
Sent: 06 October 2020 02:43
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
David,
I have just started messing around with a docker image that I found online that scrapes the data from the Solarman/Solis/Ginlong site.
It looks promising – I just have to adapt it for my 3 phase units and might use that as the interim step
Here is the link if you are interested – takes no time to spin up the docker image
https://hub.docker.com/r/fredericvl/ginlong-solis-scraper
Craig
From: davidbroster <[email protected]<mailto:[email protected]>>
Sent: Tuesday, October 6, 2020 4:23 AM
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]>>
Cc: Craig Curtin <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
I’ve been away from my hobby desk after back-surgery, but now I’m starting to (re)get up to speed by sniffing my network and nothing is being sent to the 2nd server here either. My stick has “402” designation so I’m going to try the intercept of the main server code that was posted for 402 sticks (https://github.com/t3kpunk/Omniksol-PV-Logger). I’ll report back
David
From: craigcurtin-dev <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Sent: 05 October 2020 08:47
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Cc: David Broster <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>; Comment <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
OK more updates on my progress or lack thereof.
The WIFI sticks (as probably everyone knows already) are made by IGEN/Solarman. The Solis/Ginlong website is just a rebranded version of their system.
It appears to be random but the majority of new sticks are now using the V5 protocol when sending data to Ginlong. They also appear to totally ignore the 2nd server setting and never send anything out.
For future reference the Solis 3P5K-4G inverter that i have (i have two of them) has a single RS485 bus that is exposed to us - when using the WIFI dongle it is plugged into that RS485 bus and will only work with the inverter set to address 1.
So having multiple inverters means there is no way to have two of them on the same RS485 bus.
Igate also make a WIFI box for the situation where you may have multiple inverters - it is marketed by Solis as the DLB (Data Logging Box) - here in Australia it sells for $350 ex gst and then you have to buy a wiring loom for it - RJ45 on the DLB end and RS485 Circular 4 pin connector - which is an ExceedCon unit and is extremely hard to source - still looking for that seperately.
I intend to ditch the WIFI stick and move to RS485 between the inverters and my monitoring system
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXG23BH35RBGP6534ITSJF2YVANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST2UAKO36T5URLQ7GLTSJH6GPANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXDE644OBNK7UBAEOW3SJJYZNANCNFSM4EAHVYZQ>.
|
That sounds like a cracking solution. I too gave up on the ginlong stick long ago, would frequently drop off the network and not report for days. :/ Got loads of Pi zero and RS485 adapters spare, so sounds like a great plan.
|
Darren, it would be simpler to be in direct email contact rather then via github ……
Let me know …..
& where are you located ?
David
…________________________________
David & Margaret Broster
“Greenewood”, The Park, Great Barton, IP31 2SX, Suffolk, United Kingdom
GPS Coordinates: N52°16'14" E00°45'45" (52.270758, 0.762636) http://maps.google.com/[email protected],0.762636
House: +44 (0)1284 788 255
Mobile David +44 (0)7557 359 095 [email protected]<mailto:[email protected]>
Mobile Margaret +44 (0)7557 359 417 [email protected]<mailto:[email protected]>
________________________________
From: Darren Poulson <[email protected]>
Sent: 29 October 2020 13:40
To: graham0/ginlong-wifi <[email protected]>
Cc: David Broster <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
That sounds like a cracking solution. I too gave up on the ginlong stick long ago, would frequently drop off the network and not report for days. :/
Got loads of Pi zero and RS485 adapters spare, so sounds like a great plan.
Hi Craig, I “gave up” on the scraping and redirecting route and decided to “hack” my ‘402’ stick by adding a ‘Raspberry Pi Zero W’ and USB-RS485 adapter (yes it will all fit inside the original stick !!!). So I retain the Ginlong wifi-stick website reporting and added my own private data-grab. A little bit of Python3 to send modbus group 4 register reads to the Solis …. which are then decoded and shipped as serialised (pickled) through a python LAN socket to my hot water tank immersion heater controller (another RasPi Zero W). Low cost, low effort and It works really well grabbing updates every minute. The tank side ‘listens’ 24/7 and of course the Solis side shuts down overnight, which upset the tank-side watchdog so I’m currently rewriting some of the tank-side code to accommodate and at the same time producing some hourly ‘matplotlib’ graphics. I’m happy with this solution and will share if you are interested. Let me know. RSVP ……… David
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXAQG43456D6KK63CX3SNFWDTANCNFSM4EAHVYZQ>.
|
I'm in Lancaster, UK. If you click on my profile, all my contact details are on there. :D |
David,
Great minds and all that – I too have given up on the data scraping it worked pretty well – but just was not updated frequently enough.
Could not crack the V5 protocol to get the Webserver to output to local more frequently either.
So In the end I found another project where someone had taken an ESP8266 and used it to jump onto the Modbus and do the querying and reporting.
I almost have this working now after a bit of hacking around – and you are right it does fit in the wifi shell – just a little tight.
So I should end up with both the Solarman reporting and my own inhouse stuff.
I have a couple of Rpi around the house – no Ws yet though – sounds like a great project so If you are happy to share notes etc I might gravitate up to this – did you just tap into the 5v from the inverter to power the Pi ?
I was just in the process of documenting my ESP8266 adventures (and trying to tidy up the Frankenstein prototype I setup for testing.)
My email is craigc@-at-#prosis.com.au<mailto:craigc@-at-#prosis.com.au>
Craig
From: davidbroster <[email protected]>
Sent: Thursday, October 29, 2020 11:21 PM
To: graham0/ginlong-wifi <[email protected]>
Cc: Craig Curtin <[email protected]>; Comment <[email protected]>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
Hi Craig,
I “gave up” on the scraping and redirecting route and decided to “hack” my ‘402’ stick by adding a ‘Raspberry Pi Zero W’ and USB-RS485 adapter (yes it will all fit inside the original stick !!!). So I retain the Ginlong wifi-stick website reporting and added my own private data-grab. A little bit of Python3 to send modbus group 4 register reads to the Solis …. which are then decoded and shipped as serialised (pickled) through a python LAN socket to my hot water tank immersion heater controller (another RasPi Zero W). Low cost, low effort and It works really well grabbing updates every minute. The tank side ‘listens’ 24/7 and of course the Solis side shuts down overnight, which upset the tank-side watchdog so I’m currently rewriting some of the tank-side code to accommodate and at the same time producing some hourly ‘matplotlib’ graphics. I’m happy with this solution and will share if you are interested. Let me know.
RSVP ……… David
From: craigcurtin-dev <[email protected]<mailto:[email protected]>>
Sent: 06 October 2020 02:43
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]>>
Cc: David Broster <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
David,
I have just started messing around with a docker image that I found online that scrapes the data from the Solarman/Solis/Ginlong site.
It looks promising – I just have to adapt it for my 3 phase units and might use that as the interim step
Here is the link if you are interested – takes no time to spin up the docker image
https://hub.docker.com/r/fredericvl/ginlong-solis-scraper
Craig
From: davidbroster <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Sent: Tuesday, October 6, 2020 4:23 AM
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Cc: Craig Curtin <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>; Comment <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
I’ve been away from my hobby desk after back-surgery, but now I’m starting to (re)get up to speed by sniffing my network and nothing is being sent to the 2nd server here either. My stick has “402” designation so I’m going to try the intercept of the main server code that was posted for 402 sticks (https://github.com/t3kpunk/Omniksol-PV-Logger). I’ll report back
David
From: craigcurtin-dev <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>>
Sent: 05 October 2020 08:47
To: graham0/ginlong-wifi <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>>
Cc: David Broster <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>>; Comment <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]%3cmailto:[email protected]>>>>
Subject: Re: [graham0/ginlong-wifi] Done some work on a 4G stick (#4)
OK more updates on my progress or lack thereof.
The WIFI sticks (as probably everyone knows already) are made by IGEN/Solarman. The Solis/Ginlong website is just a rebranded version of their system.
It appears to be random but the majority of new sticks are now using the V5 protocol when sending data to Ginlong. They also appear to totally ignore the 2nd server setting and never send anything out.
For future reference the Solis 3P5K-4G inverter that i have (i have two of them) has a single RS485 bus that is exposed to us - when using the WIFI dongle it is plugged into that RS485 bus and will only work with the inverter set to address 1.
So having multiple inverters means there is no way to have two of them on the same RS485 bus.
Igate also make a WIFI box for the situation where you may have multiple inverters - it is marketed by Solis as the DLB (Data Logging Box) - here in Australia it sells for $350 ex gst and then you have to buy a wiring loom for it - RJ45 on the DLB end and RS485 Circular 4 pin connector - which is an ExceedCon unit and is extremely hard to source - still looking for that seperately.
I intend to ditch the WIFI stick and move to RS485 between the inverters and my monitoring system
Craig
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXG23BH35RBGP6534ITSJF2YVANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST2UAKO36T5URLQ7GLTSJH6GPANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACE5ZXDE644OBNK7UBAEOW3SJJYZNANCNFSM4EAHVYZQ>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#4 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AM6OST4WQOGJUSL5BNSK7LDSNFM4PANCNFSM4EAHVYZQ>.
|
Fascinating reading! Did anyone ever make any more progress with the 5G inverter and newer sticks? |
Hi NickSutton. I don't know. It will rely on someone who owns one to have a play with it.
Graham.
…On 21 July 2022 22:03:06 BST, NickSutton ***@***.***> wrote:
Fascinating reading! Did anyone ever make any more progress with the 5G inverter and newer sticks?
--
Reply to this email directly or view it on GitHub:
#4 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Hi,
Just wanted to say thanks for the work you did, gave me a great starting point for reverse engineering the protocol on a 4G stick.
https://github.com/dpoulson/ginlong-mqtt
Still a lot of work to do on it, they don't make it easy do they? Also tempted to possibly hook it up to a different supply so that it is on all the time, not just when there is solar. Maybe also crack it open and see what its running.
The text was updated successfully, but these errors were encountered: