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

reader.available() remains false using Wemos d1 mini #38

Open
ErwinP opened this issue Feb 9, 2021 · 2 comments
Open

reader.available() remains false using Wemos d1 mini #38

ErwinP opened this issue Feb 9, 2021 · 2 comments

Comments

@ErwinP
Copy link

ErwinP commented Feb 9, 2021

Hi,

I'm trying to use this library in combination with a Wemos d1 mini v3 and hardwareserial. I live in Belgium, and got a sagemcom t211 installed. I'm aware that Belgium uses a slightly different OBIS syntax, but this is not the problem.

I have managed to connect and get a read by applying this scheme from silvanverschuur , together with his script (i.e. a manual parsing of the telegram). However, given the several benefits from using your library, I'd like to start using it. I started off by using the read.ino from the examples folder.

I have tried a lot of setups to connect the Wemos to the P1 port, but can't seem to get past the if(reader.available()) statement: it never becomes true. My gut feeling tells me that it is due to the lack of the request pin, but I can't seem to find out how to properly connect it. The most simple solution, making a direct connection from P1's pin 3 to Wemos pin D2, isn't doing the trick.

I don't know how to proceed from this point on, and my stubbornness is already causing quite some sleep deprivation. Any help on this matter would be incredibly appreciated.

Edit

Oh my, apparently there is a difference in pin numbers between the Wemos d1 mini and the Arduino IDE: https://chewett.co.uk/blog/1066/pin-numbering-for-wemos-d1-mini-esp8266/

I now have to try everything again, and will report back. In the mean time, please don't hesistate if you have suggestions.

Thank you in advance,
Erwin

@matthijskooijman
Copy link
Owner

IIRC checksum errors can also prevent the reader from returning available() as true (but I also think that error logging here isn't ideal currently).

If there is no request pin, does the port always send unconditionally?

It would be good to confirm if serial is receiving any bytes at all, maybe by adding some debug prints in the library.

See also #27 about differences between the Belgian and Dutch DSMR formats. IIRC the Belgian format is not really supported, but as you suggest, I would just expect missing fields rather than no data at all (though maybe failed parsing prevents available, not entirely sure).

@keukenrol
Copy link

keukenrol commented Feb 27, 2023

Hi Erwin, do you have your setup running? I have an esp32 and a transistor to invert the data from the T211 to the rx2 input. However when using the read example I dont get actual data. I know the output does work correctly when uploading my own sketch and just showing what is read from serial2 and printing it on serial.

Considering the request pin, the esp32 is 3.3V logic while the P1 wants the request pin high on 5V. I used a transistor to change the levels for this.

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

No branches or pull requests

3 participants