-
Notifications
You must be signed in to change notification settings - Fork 20
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
Support ESP-IR #40
Comments
this took me 15 minutes to make a compile option to invert software serial, would be some more effort to make that configurable with a command #define TS_SWS_INVERT see repo |
But even with this fixed the transmitter is always on and flashing when sending. What's happening? |
this is only working for software serial , hardware serial can not be inverted. the pin i forgot should set the trx GPIO to the right level. it should definitely work for sending. for receiving i forgot the level change interrupt active transition, i will check that later |
The problem was Now enforcing that |
yes i forgot that we are in a library. |
Testing receiption with my EasyMeter (it sends telegrams every 2secs) does not work. Need to test later against my IR head in both directions. |
Sending strings from ESP-IR with up to 14.400 baud works. Starting from 19.200 things get messy. The meter I have which requires sending is only at 1.200 baud thus ok. Receiving strings with ESP-IR does not work even at 1.200 or 300 baud. My Kamstrup request ( |
first check if the non inverse version works both for sending and receiving. |
Using original Tasmota on both ends leads to this: Both modules configured to IRsend/IRrecv
Both modules configured to TCP Tx/Rx with
Data sent from D0 to ESP-IR is not received.
|
@s-hadinger Are you able to to give some insight why a bit-inverted TasmotaSerial.cpp installed on ESP-IR is working for sending but not for receiving?Maybe you've got some idea where to continue investigation? |
This looks like a duplicate from arendst#16447 |
If that's the same issue, it is possible to invert Hardware Serial, but it requires an additional parameter that is not present in TasmotaSerial (nor in Arduino if I remember well). The standard Tasmota has no plan to introduce this change. Honestly this does not look as the good approach. IR is not meant to be used as On/Off, as this generates too much interference. It is typically sent with a carrier of 38KHz so that the receiver can filter out glitches and only retain what correpond to the carrier frequency. You can probably use higher frequency carriers, but this requires much more than just plugging serial to the IR diode. |
The discussion at the main repo got stalled so sorry for the duplicate. Once solved I'll close it with a link to the solution. The IR communication both threads are dealing with is about reading certain energy meters via standardized D0 interface. It's not about signals from TV remotes and so on. As I said above the D0 IR head probably sports a Schmitt trigger (see linked schematics above) which inverts plain TTL signals thus the head is working as is on hardware and software serial from Tasmota or on a FTDI. The factory-made ESP-IR has its diodes connected to GPIO 4 and 14 thus software serial. As try and error has shown switching HIGH and LOW did work for sending. This makes me wonder what is missing for receiving. |
@TheChatty |
yes that would work. if you stay with inverted logic you should wire the photodiode so that the logic level is zero when no light is present. |
I'd try to simply connect SFH309FA to the same pin where VS838 is connected at the moment. I assume it's directly hooked up to GPIO14 from ESP. Maybe no bit inversion is need for receiption. |
SML works fine with some ESP8266 and D0 transceiver on hardware and software serial.
Now I'd like to change to ESP-IR (integrated board with emitter and receiver):
Serial TX/RX
: transmitter is always off and only blinking onSerialSend ...
.Serial TX/RX
: transmitter is always on and blinking off onSerialSend ...
. Both diodes are wired to GPIO4/14 thus software serial.I guess there is an inverting Schmitt trigger in the D0 head. For obvious reasons that cannot be easily integrated into ESP-IR.
Is there an easy solution to invert their behavior for SML? (e.g. change all lines in TasmotaSerial.cpp containg
digitalRead
anddigitalWrite
in a clever way)The text was updated successfully, but these errors were encountered: