Skip to content
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

Eastron SDM630 energy meter - new sensor #2735

Closed
wants to merge 5 commits into from
Closed

Eastron SDM630 energy meter - new sensor #2735

wants to merge 5 commits into from

Conversation

gtortone
Copy link
Contributor

Hi,
integration of a new sensor: Eastron SDM630 three-phase power meter.

Regards,
Gennaro

@arendst
Copy link
Owner

arendst commented May 15, 2018

Thnx.

I'm in the middle of a release update which will use your changes to xsns_23_sdm120.ino. This has just been released in the development branch.

@gtortone
Copy link
Contributor Author

gtortone commented May 15, 2018

Hi, I added also a Python implementation of HTTP server for OTA updates

Requirements:
   - Python3
   - pip install netifaces flask 

Instructions:
    Copy Sonoff-Tasmota firmware binary files in 'fw' directory. 
    A set of prebuilt files can be downloaded by Sonoff-Tasmota release page:
        https://github.com/arendst/Sonoff-Tasmota/releases

    Configure your Sonoff-Tasmota device with your fw-server URL:
        Firmware Upgrade -> Upgrade by web server
            http://<ip_address>:5000/sonoff-minimal.bin

Usage:
   ./fw-server.py -d <net_iface>   (default: eth0)

Example:
    ./fw-server.py -d wlan0

@arendst
Copy link
Owner

arendst commented May 15, 2018

Grrrrrrrrrrrrrr. You are blowing my release Travis compiles.....

@arendst
Copy link
Owner

arendst commented May 15, 2018

Restarting the build just now. Give 15 minutes for the binaries to compile.....

@gtortone
Copy link
Contributor Author

Sorry,
I will wait for your release !!

@gtortone
Copy link
Contributor Author

@arendst please let me know what do you think about fw-server... I know it should be a separated PR !

@arendst
Copy link
Owner

arendst commented May 15, 2018

It's a great idea and a good alternative for an apache server et al.

I play with it and let you know my findings (when I'm at rest after finishing the release...)

@arendst
Copy link
Owner

arendst commented May 15, 2018

Release finished. It's all yours again...

@MatzeJoerling MatzeJoerling mentioned this pull request May 16, 2018
@MatzeJoerling
Copy link

Hi, keep in mind that rs485 is a bus, and
frame[0] = 0x01; // default SDM630 Modbus address
works only for one device on address 1.
I plan to have 3 SDM630 and 2 SDM230 (house, apartment, total, solar plant and what we use together) al sitting on the same RS485 cable. Would be nice to query them with one tasmota device, not 5 ;-)

A config option where i can set up SDM630 / 230 addresses would be needed, also some sort of "autodetetion" (120,230,530,630 on address) would be something to consider for version 2.x

btw, nice job. Will free me a raspi that is doing the rs485 job now! thanks a lot!

@gtortone
Copy link
Contributor Author

@MatzeJoerling Yes, RS485 is a bus and SDM120 sensor for Sonoff-Tasmota is a first release that could grow in next future (I hope). I'm starting to think how to implement the ID setting of a 'set' of SDM sensors and my first idea is by MQTT messages (or serial / web console)...

arendst added a commit that referenced this pull request May 16, 2018
5.14.0a
 * Add Eastron SDM630 energy meter (#2735)
@arendst
Copy link
Owner

arendst commented May 16, 2018

Released. I still need time to investigate the fw-server though so that has to wait.

It's in my local repository so I suggest to close this PR.

@gtortone
Copy link
Contributor Author

Thanks a lot !
I close this PR.

@gtortone gtortone closed this May 16, 2018
@arendst
Copy link
Owner

arendst commented May 17, 2018

@gtortone I tried your webserver and I like it's simplicity!!!

On Linux it works great and so much easier than setting up an apache server et al.
Still testing on windows ...

@gtortone
Copy link
Contributor Author

@arendst Thanks ! With Flask framework an HTTP file server in ~30 Python lines of code is very impressive (and simple) !

@arendst
Copy link
Owner

arendst commented May 17, 2018

Still struggling with windows...

I manage to find my interface device name which also returns the correct IP address:

PS C:\data\work\python\webserver> Get-WmiObject -Class Win32_NetworkAdapterConfiguration |
>>   Select-Object Description, SettingID, MACAddress |
>>   Format-Table -AutoSize

Description                            SettingID                              MACAddress
-----------                            ---------                              ----------
Microsoft Kernel Debug Network Adapter {8718928D-CBEB-45EA-A621-800A9249001D}
Realtek PCIe GBE Family Controller     {AC6EA539-40B4-4921-A3BD-E081354D06CC} BC:EE:7B:88:BE:E8
WAN Miniport (SSTP)                    {C28A6536-C1AA-4026-9B15-58F337F65624}
WAN Miniport (IKEv2)                   {5912B8F1-6D8C-4BD3-939F-C9015509D445}
WAN Miniport (L2TP)                    {1528592A-2D55-4DFA-AED4-DFC576D01CA7}
WAN Miniport (PPTP)                    {35B39527-575F-41D3-9660-F92ACECFC980}
WAN Miniport (PPPOE)                   {02BCD74C-DBBF-4AD8-8546-F614B6689EA0}
WAN Miniport (IP)                      {2661AE79-E0EA-419C-B9A2-3AAD7019D3A4} B6:54:20:52:41:53
WAN Miniport (IPv6)                    {2F90692C-2543-49BB-8131-513DA93A59C3} BC:BC:20:52:41:53
WAN Miniport (Network Monitor)         {5FF95355-CF1F-40F9-B084-63C0FB6EBB9E} C0:9E:20:52:41:53
PS C:\data\work\python\webserver> py
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import netifaces
>>> netifaces.interfaces()
['{AC6EA539-40B4-4921-A3BD-E081354D06CC}', '{C868B1ED-BFC2-11E7-8B0C-806E6F6E6963}']
>>> netifaces.ifaddresses('{AC6EA539-40B4-4921-A3BD-E081354D06CC}')[netifaces.AF_INET][0]['addr']
'192.168.2.1'

but executing the fw-server always returns this:

PS C:\data\work\python\webserver> .\fw-server.py --dev {AC6EA539-40B4-4921-A3BD-E081354D06CC}
Usage: fw-server.py [options]

fw-server.py: error: no such option: -I

Beats me where the option -I comes from

@gtortone
Copy link
Contributor Author

Hi,
see here: #2759

@gtortone
Copy link
Contributor Author

btw I suppose you should try with:

.\fw-server.py --dev '{AC6EA539-40B4-4921-A3BD-E081354D06CC}'

@arendst
Copy link
Owner

arendst commented May 17, 2018

No that returns:

.\fw-server.py --dev '{AC6EA539-40B4-4921-A3BD-E081354D06CC}'
E: network interface error - list index out of range

Without the quotes it gets past the network interface check but fails down the line.

curzon01 pushed a commit to curzon01/Tasmota that referenced this pull request Sep 7, 2018
5.14.0a
 * Add Eastron SDM630 energy meter (arendst#2735)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants