UtilitechAS / amsreader-firmware

ESP8266 and ESP32 compatible firmware to read, interpret and publish data to MQTT from smart electrical meters, both DLMS and DSMR is supported
Other
386 stars 73 forks source link

Wired AmsToMqttBridge? #365

Closed attah closed 7 months ago

attah commented 1 year ago

Is your feature request related to a problem? Please describe. There are some places without wifi, but that may well have wired ethernet (e.g. basements in multi-tenant houses). And there are even some nice PoE-powered, wired, ESP32s like https://shop.m5stack.com/products/esp32-ethernet-unit-with-poe?variant=42675684966657

Describe the solution you'd like Would you be interested in enabling AmsToMqttBridge to use the built-in ethernet MAC on the ESP32? I'm currently a bit low on spare time so haven't got far, but i have bought the hardware, set up the environment and programmer, and am slowly starting to look at what it would take.

So i just wanted to gauge how, if at all, involved you'd want to be. If you are anything like me with open projects, there might be some parts and/or some prep that you'd want to get out of the way first. Or you maybe already thought of this and have some ideas/suggestions... or you might even want more involvement. (I'll gladly sponsor you for the hardware)

Or if you don't, i hope you'd at least accept pull requests for this so that it doesn't end up being a fork.

What do you say? :)

Describe alternatives you've considered One can always sprinkle wifi access points everywhere... but this is cheaper and options are always nice.

Additional context

gellfuen commented 10 months ago

... oh! still recognized "bootloader_dio_40m.bin" will not be flashed

gellfuen commented 10 months ago

Hello, Happy new Year! just kindly asking for update about the missing stuff for wired profile for WT32-ETH01.... BR

gellfuen commented 8 months ago

@gskjold: I don't want to be a nuisance, but from your last statement it seemed that only one small thing was missing. Will that perhaps still be finished after all? BR

gskjold commented 8 months ago

Please try the attached version, it should work for you

esp32.zip

gellfuen commented 8 months ago

Hi! thanks for the new version, but it only reboots:

on terminal I get this output repeating very fast, always the same text.

rst:0x3 (SW_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12732 ho 0 tail 12 room 4 load:0x40080400,len:2908 entry 0x400805c4 ets Jun 8 2016 00:22:57

regards

gskjold commented 8 months ago

I see what is going on, try this one: esp32.zip

gellfuen commented 8 months ago

THX, hmmmm still rebooting, but much slower...

Bootlog:

ets Jun 8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12732 ho 0 tail 12 room 4 load:0x40080400,len:2908 entry 0x400805c4 (I) AMS bridge started (I) Voltage: 0.00V (D) ESP32 LittleFS (D) size: 1441792, used: 8192 (I) No configuration, booting AP (I) Entering setup mode (I) (setupHanPort) Setting up HAN on pin 255 with baud 0 and parity 0 (D) Hardware serial Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled. Memory dump at 0x40116938: ffffffff ffffffff c332c3a6 Core 1 register dump: PC : 0x4011693c PS : 0x00060330 A0 : 0x80117d06 A1 : 0x3ffcb6b0 A2 : 0x00000001 A3 : 0x00000009 A4 : 0x011a0009 A5 : 0x00000009 A6 : 0x00060323 A7 : 0x00060320 A8 : 0x80116eb5 A9 : 0x3ffcb690 A10 : 0x00000009 A11 : 0x00000011 A12 : 0x3ff49054 A13 : 0x0000abab A14 : 0x003fffff A15 : 0x00060320 SAR : 0x00000009 EXCCAUSE: 0x00000000 EXCVADDR: 0x00000000 LBEG : 0x4008a64c LEND : 0x4008a657 LCOUNT : 0xffffffff

Backtrace: 0x40116939:0x3ffcb6b0 0x40117d03:0x3ffcb6d0 0x401158c3:0x3ffcb700 0x40113170:0x3ffcb760 0x400dcdd5:0x3ffcb7b0 0x400dceb9:0x3ffcb7e0 0x400d483f:0x3ffcb800 0x40115b9d:0x3ffcbaf0

ELF file SHA256: 0000000000000000

Rebooting... ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:184 load:0x40078000,len:12732 ho 0 tail 12 room 4 load:0x40080400,len:2908 entry 0x400805c4

regards

egiljae commented 8 months ago

Here is an update, fixing hostname and fixed IP, as well as IP display on status page: ~esp32.zip~ edit: Found a fault in the firmware above, use this: esp32.zip

Trying to setup LilyGo T-Internet-POE with this firmware. I have previously been using UART2 (GPIO16) while in wireless mode. Ethernet mode works fine, but as soon as I select UART2 for HAN RX, the board becomes unresponsive. I guess the ethernet chip uses UART2? Which pin should I use for HAN RX on this board while in ethernet mode?

ArnieO commented 8 months ago

Trying to setup LilyGo T-Internet-POE with this firmware. I have previously been using UART2 (GPIO16) while in wireless mode. Ethernet mode works fine, but as soon as I select UART2 for HAN RX, the board becomes unresponsive. I guess the ethernet chip uses UART2? Which pin should I use for HAN RX on this board while in ethernet mode?

You need to study the documentation for your board, select a GPIO that is not used by the board, use that GPIO for HAN Rx - and adjust the configuration for the firmware to read HAN data from that GPIO.

egiljae commented 8 months ago

Trying to setup LilyGo T-Internet-POE with this firmware. I have previously been using UART2 (GPIO16) while in wireless mode. Ethernet mode works fine, but as soon as I select UART2 for HAN RX, the board becomes unresponsive. I guess the ethernet chip uses UART2? Which pin should I use for HAN RX on this board while in ethernet mode?

You need to study the documentation for your board, select a GPIO that is not used by the board, use that GPIO for HAN Rx - and adjust the configuration for the firmware to read HAN data from that GPIO.

Since the documentation recommends using hardware serial, I assume UART[0-2] is preferred. I can see that UART0 maps to GPIO3, and UART1 maps to GPIO9, both which are unavailable on the LilyGo GPIO header. I was just curious if software serial is the only option when using ethernet?

ArnieO commented 8 months ago

Since the documentation recommends using hardware serial, I assume UART[0-2] is preferred. I can see that UART0 maps to GPIO3, and UART1 maps to GPIO9, both which are unavailable on the LilyGo GPIO header. I was just curious if software serial is the only option when using ethernet?

Newer ESP32 chips have a multiplexer, and can use HW serial on just about all GPIOs. So that will depend on your board.

gskjold commented 8 months ago

T-Internet-POE uses GPIO17 (UART2-TX), so UART2 cannot be used with this board.

gskjold commented 8 months ago

THX, hmmmm still rebooting, but much slower...

Have you tried erase-flash before flashing new version?

gellfuen commented 8 months ago

correct, did the erase before and tried that 2 times..

regards

Am Do., 29. Feb. 2024 um 14:15 Uhr schrieb Gunnar Skjold < @.***>:

THX, hmmmm still rebooting, but much slower...

Have you tried erase-flash before flashing new version?

— Reply to this email directly, view it on GitHub https://github.com/UtilitechAS/amsreader-firmware/issues/365#issuecomment-1971115516, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXS7BSQKE5XZMWZZZEJGUTYV4UWRAVCNFSM6AAAAAASMRI7OCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZRGEYTKNJRGY . You are receiving this because you were mentioned.Message ID: @.***>

Noschvie commented 8 months ago

@gellfuen you are using the WT32-ETH01, isn't?

gellfuen commented 8 months ago

@Noschvie yes, that from case #673 regards

Noschvie commented 8 months ago

Have two of them in use with ETH and Tasmota. But ETH is slow and ping requests timed out. Maybe not the best choice... The Olimex ESP32-PoE with ETH works much better, same as with wifi. I'm replacing them with Olimex ESP32

gellfuen commented 8 months ago

Hi! THX for that information, did not know that! So that WT32-ETH01 only looks good ;-) but LAN function is not the best - ok.

Am Sa., 2. März 2024 um 20:18 Uhr schrieb Norbert @.***

:

Have two of them in use with ETH and Tasmota. But ETH is slow and ping requests timed out. Maybe not the best choice... The Olimex ESP32-PoE with ETH works much better, same as with wifi. I'm replacing them with Olimex ESP32

— Reply to this email directly, view it on GitHub https://github.com/UtilitechAS/amsreader-firmware/issues/365#issuecomment-1974884037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJXS7BWLA5NLPI7ETD4DWQLYWIQYLAVCNFSM6AAAAAASMRI7OCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZUHA4DIMBTG4 . You are receiving this because you were mentioned.Message ID: @.***>

Noschvie commented 8 months ago

Found this, maybe it helps @gellfuen Tasmota command EthClockMode 0 (3 is default) https://github.com/arendst/Tasmota/discussions/19803#discussioncomment-7337447

davidg-0 commented 1 month ago

Can we set something like "EthClockMode 0" also in this firmware? Or does there need to be a special build?