daniel-jong / esp8266_p1meter

DSMR5 P1 meter to mqtt using esp8266
GNU General Public License v3.0
152 stars 54 forks source link

Error during compiling: 'TX' was not declared in this scope #2

Closed gustavstrandberg closed 4 years ago

gustavstrandberg commented 4 years ago

Hi!

First of all, thanks for a great job!

I got an Landis+Gyr E360 installed last week and I am trying to read out information from the P1 port. I have an Wemos D1 mini ver 1, connected to a R11 cable according to your pictures.

I get an error compiling the code "'TX' was not declared in this scope". If I change '#define SERIAL_TX TX' to '#define SERIAL_TX D0' in settings.h I can complie the code and upload. But i do not get any response from ther E360 meter. The only action I see is that I get a message over MQTT saying "p1 meter alive: p1meter". But thats it.

The serial monitor does not give anything out of the ordinary. It confirms that it inverts UART0 RX, connects to WiFi and MQTT.

I am using Arduino IDE 1.8.13 and have downloaded the latest PubSubClient and WifiManager.

Help to resolve this is gladly appriciated.

Thanks, Gustav

daniel-jong commented 4 years ago

Hi Gustav,

Could you check if you have selected the correct board in the arduino? The RX and TX constants are set automagically based on the board you select. I'm also using a D1 mini v1 and using LOLIN(WEMOS) D1 R2 & mini as the selected board everything compiles without issue.

If this doesn't work be sure that you are using the correct pin numbers. D0 would be one of the 'normal' GPIO's, but in this fork we are using the RX pin (and indirectly the TX pin). I think that you should try using pin 1 for the TX and pin 3 for the RX. pinout

Let me know if this helps!

Regards, Daniël

gustavstrandberg commented 4 years ago

Hi Daniel and thanks for a fast answer!

I had selected "WeMos D1 R1", selecting "LOLIN(WEMOS) D1 R2 & mini" worked. Thanks!

Best regards Gustav

gustavstrandberg commented 4 years ago

I have uploaded the compiled file, Still no response from the E360 meter. I will ask my electrical company if they need to activate the P1 port from their side. /Gustav