arduino-dsmr icon indicating copy to clipboard operation
arduino-dsmr copied to clipboard

reader.available() remains false using Wemos d1 mini

Open ErwinP opened this issue 3 years ago • 2 comments

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

ErwinP avatar Feb 09 '21 10:02 ErwinP

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).

matthijskooijman avatar Feb 09 '21 11:02 matthijskooijman

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.

keukenrol avatar Feb 27 '23 14:02 keukenrol