Browse Source

Merge branch 'main' into development03

pull/254/head
Andreas Schiffler 2 years ago
committed by GitHub
parent
commit
fcc394c1de
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/compile_esp8266.yml
  2. 2
      README.md
  3. BIN
      doc/AhoyWemosD1.fzz
  4. BIN
      doc/AhoyWemos_Schaltplan.jpg
  5. BIN
      doc/AhoyWemos_Steckplatine.jpg
  6. 45
      tools/esp8266/README.md
  7. 4
      tools/esp8266/User_Manual.md
  8. 3
      tools/rpi/hoymiles/__main__.py
  9. 3
      tools/rpi/hoymiles/outputs.py

2
.github/workflows/compile_esp8266.yml

@ -51,7 +51,7 @@ jobs:
draft: false
prerelease: false
release_name: ${{ steps.rename-binary-files.outputs.name }}
tag_name: ${{ github.ref }}
tag_name: ${{ steps.rename-binary-files.outputs.name }}
body_path: tools/esp8266/CHANGES.md
env:
GITHUB_TOKEN: ${{ github.token }}

2
README.md

@ -3,7 +3,7 @@
![Logo](https://github.com/grindylow/ahoy/blob/main/doc/logo1_small.png?raw=true)
# ahoy
Ahoi is a project to bypass the original Hoymiles cloud solution.
Ahoy is a project to bypass the original Hoymiles cloud solution.
In order to use this project, it is important what the area of ​​​​application looks like.
With each version it is necessary to have an NRF24L01+.

BIN
doc/AhoyWemosD1.fzz

Binary file not shown.

BIN
doc/AhoyWemos_Schaltplan.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
doc/AhoyWemos_Steckplatine.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

45
tools/esp8266/README.md

@ -3,6 +3,7 @@
- [Overview](#overview)
- [Compatiblity](#compatiblity)
- [Things needed](#things-needed)
+ [Faked Modules Warning](#there-are-fake-nrf24l01-modules-out-there)
- [Wiring things up](#wiring-things-up)
+ [ESP8266 wiring example](#esp8266-wiring-example)
- [Flash the Firmware on your Ahoy DTU Hardware](#flash-the-firmware-on-your-ahoy-dtu-hardware)
@ -53,11 +54,13 @@ We suggest to use a WEMOS D1 mini Board as well as a NRF24L01+ Breakout Board.<b
Make sure it has the "+" in its name as we depend on some features provided with the plus-variant.<br/>
Any other ESP8266 Board with at least 4MBytes of ROM could work as well, depending on your skills.
#### There are fake NRF24L01+ Modules out there
Whatch out, there are some fake NRF24L01+ Modules out there that seem to use rebranded NRF24L01 Chips (without the +).<br/>
An example can be found in [Issue #230](https://github.com/grindylow/ahoy/issues/230).<br/>
You are welcome to add more examples of faked chips. We will that information here.<br/>
## Wiring things up
The NRF24L01+ radio module is connected to the
standard SPI pins:
The NRF24L01+ radio module is connected to the standard SPI pins:
- SCLK (Signal Clock),
- MISO (Master In Slave Out) and
- MOSI (Master Out Slave In)
@ -72,8 +75,9 @@ Additional, there are 3 pins, which can be set individual:
*These pins can be changed from the /setup URL.*
#### ESP8266 wiring example
ToDo: (this one needs to be reworked - also a generified one would be helpful)
<img src="https://github.com/grindylow/ahoy/blob/main/doc/ESP8266_nRF24L01%2B_bb.png" width="300">
This is an example wiring using a Wemos D1 mini.<br>
<img src="https://github.com/grindylow/ahoy/blob/main/doc/AhoyWemos_Steckplatine.jpg" width="300">
<img src="https://github.com/grindylow/ahoy/blob/main/doc/AhoyWemos_Schaltplan.jpg" width="300">
@ -131,20 +135,25 @@ When everything is wired up and the firmware is flashed, it is time to connect t
#### Your Ahoy DTU is very verbose using the Serial Console
When connected to your computer, you can open a Serial Console to obtain additional information.
This might be useful in case of any troubles that might occur as well as to simply obtain information about the converted values which were read out of the inverter(s).
When connected to your computer, you can open a Serial Console to obtain additional information.<br/>
This might be useful in case of any troubles that might occur as well as to simply<br/>
obtain information about the converted values which were read out of the inverter(s).
#### Connect to the Ahoy DTU Webinterface using your Browser
After you have sucessfully flashed and powered your Ahoy DTU, you can access it via your Browser.
If your Ahoy DTU was able to log into the configured WiFi Network, it will try to obtain an IP-Address from your local DHCP Server (in most cases thats your Router).
In case it could not connect to your configured Network, it will provide its own WiFi Network that you can connect to for furter configuration. The WiFi SSID *(the WiFi Name)* and Passwort is configured in the config.h and defaults to the SSID "AHOY-DTU" with the Passwort "esp_8266".
The Ahoy DTU will keep that Network open for a certain amount of time (also configurable in the config.h and defaults to 60secs). If nothing connects to it and that time runs up, it will retry to connect to the configured network an so on.
If connected to your local Network, you just have to find out the used IP Address. In most cases your Router will give you a hint.
If you connect to the WiFi the Ahoy DTU opens in case it could not connect to any other Network, the IP-Address of your Ahoy DTU is 192.168.1.1.
Just open the IP-Address in your browser.
After you have sucessfully flashed and powered your Ahoy DTU, you can access it via your Browser.<br/>
If your Ahoy DTU was able to log into the configured WiFi Network, it will try to obtain an IP-Address<br/>
from your local DHCP Server (in most cases thats your Router).<br/><br/>
In case it could not connect to your configured Network, it will provide its own WiFi Network that you can<br/>
connect to for furter configuration.<br/>
The WiFi SSID *(the WiFi Name)* and Passwort is configured in the config.h and defaults to the SSID "AHOY-DTU" with the Passwort "esp_8266".<br/>
The Ahoy DTU will keep that Network open for a certain amount of time (also configurable in the config.h and defaults to 60secs).<br/>
If nothing connects to it and that time runs up, it will retry to connect to the configured network an so on.<br/>
<br/>
If connected to your local Network, you just have to find out the used IP Address. In most cases your Router will give you a hint.<br/>
If you connect to the WiFi the Ahoy DTU opens in case it could not connect to any other Network, the IP-Address of your Ahoy DTU is 192.168.1.1.<br/>
Just open the IP-Address in your browser.<br/>
<br/>
The webinterface has the following abilities:
- OTA Update (Over The Air Update)
- Configuration (Wifi, inverter(s), NTP Server, Pinout, MQTT, Amplifier Power Level, Debug)
@ -153,7 +162,7 @@ When everything is wired up and the firmware is flashed, it is time to connect t
##### HTTP based Pages
To take control of your Ahoy DTU, you can directly call one of the following sub-pages (e.g. http://192.168.1.1/setup ).
To take control of your Ahoy DTU, you can directly call one of the following sub-pages (e.g. http://192.168.1.1/setup ).<br/>
| page | use | output |
| ---- | ------ | ------ |
@ -172,7 +181,7 @@ When everything is wired up and the firmware is flashed, it is time to connect t
## MQTT command to set the DTU without webinterface
[Read here](https://github.com/grindylow/ahoy/blob/development02/tools/esp8266/User_Manual.md)
[Read here](https://github.com/grindylow/ahoy/blob/main/tools/esp8266/User_Manual.md)

4
tools/esp8266/User_Manual.md

@ -226,6 +226,8 @@ Gather user inverter information here to understand what differs between some in
| eeprom23 | HM-1200 2t | 0.1.0 | 1.0.16 | 2021 | 10-12 | 269619207 | 17:06:00 | HWRev 256 |
| fila612 | HM-700 | | 1.0.10 | 2021 | 11-01 | 104 | | |
| tfhcm | TSUN-350 | | 1.0.14 | 2021 | 12-09 | 102 | | |
| Groobi | TSOL-M400 | | 1.0.14 | 2021 | 12-09 | 102 | | |
| setje | HM-600 | | 1.0.08 | 2020 | 07-10 | 104 | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
@ -243,4 +245,4 @@ This command (``` AlarmData = 17 // 0x11```) will enqued in any operation phase
In case all commands are processed (```_commandQueue.empty() == true```) then as a default command the get data (```RealTimeRunData_Debug = 11 // 0x0b```) will be enqueued.
In case a Device Control command (Power Limit, Off, On) is requested via MQTT or REST API this request will be send before any other enqueued command.
In case of a accepted change in power limit the command get active power limit in percent ( ```SystemConfigPara = 5 // 0x05```) will be enqueued. The acceptance is checked by the reponse packets on the devive control commands (tx id 0x51 --> rx id 0xD1) if in byte 12 the requested sub-command (eg. power limit) is present.
In case of a accepted change in power limit the command get active power limit in percent ( ```SystemConfigPara = 5 // 0x05```) will be enqueued. The acceptance is checked by the reponse packets on the devive control commands (tx id 0x51 --> rx id 0xD1) if in byte 12 the requested sub-command (eg. power limit) is present.

3
tools/rpi/hoymiles/__main__.py

@ -72,7 +72,8 @@ def poll_inverter(inverter, retries=4):
# Handle the response data if any
if response:
c_datetime = datetime.now()
print(f'{c_datetime} Payload: ' + hoymiles.hexify_payload(response))
if hoymiles.HOYMILES_DEBUG_LOGGING:
print(f'{c_datetime} Payload: ' + hoymiles.hexify_payload(response))
decoder = hoymiles.ResponseDecoder(response,
request=com.request,
inverter_ser=inverter_ser

3
tools/rpi/hoymiles/outputs.py

@ -215,6 +215,7 @@ class VolkszaehlerOutputPlugin(OutputPluginFactory):
"""
super().__init__(**params)
self.session = requests.Session()
self.baseurl = config.get('url', 'http://localhost/middleware/')
self.channels = dict()
for channel in config.get('channels', []):
@ -271,7 +272,7 @@ class VolkszaehlerOutputPlugin(OutputPluginFactory):
uid = self.channels[ctype]
url = f'{self.baseurl}/data/{uid}.json?operation=add&ts={ts}&value={value}'
try:
r = requests.get(url)
r = self.session.get(url)
if r.status_code != 200:
raise ValueError('Could not send request (%s)' % url)
except ConnectionError as e:

Loading…
Cancel
Save