3 ms·
well, it's not like you only have two options: "ESP32 with full TCP stack" or "IrDA". The spectrum of choices there is huge. If you want simple, get something
by theamk 4y ago
well, it's not like you only have two options: "ESP32 with full TCP stack" or "IrDA". The spectrum of choices there is huge.
If you want simple, get something like NRF2401 and send around raw radio packets. This will give you retry and checksums with minimal fuss. If you want to save power, you will have to implement sleeping code yourself, but it is not too bad.
If you want compatibility with users' devices there is BT/BLE. It is probably the closest thing to the original IrDA use case.
If you want debug/programming/generic UART use USB. As an extra bonus you get power as well.
If you want electrical isolation, use optical fiber or 3d-print a custom optical plug. I guess you can run IrDA over it, but plain UART will work as well, and will make adapter much simpler.
If you want to securely talk to a device without USB port (maybe waterproof/dustproof) then optical link may be handy.. but don't use it all the time, use optical link to transmit wireless channel/key and then switch to wifi/bt/nrf2401 link. This will give you much better UX, your link won't get broken because somone bumps the device. Oh, and yiu can run it super slow (10bps) and one way so users can transmit with their cell phone. Or use status LED as photo sensor so that you have no visible elements on your front panel.
.. so, what does this leave for IrDA? I can think about a couple of scenarios, but they all seem convoluted and uncommon.
- dragontamer 4y ago> NRF2401 Impressive part. Definitely seems to handle a lot of simple use cases. 10mA transmit/receive is certainly good. But we're still far away from 0.075mA receive currents that the TFDU4101 promises. That's 0.075mA while _active_ and 0.00001mA (0.01uA typical) when sleeping/shutdown. > If you want compatibility with users' devices there is BT/BLE. It is probably the closest thing to the original IrDA use case. Yeah, that's definitely dead. There's no more PDAs, laptops or even USB dongles for IrDA these days. > If you want to securely talk to a device without USB port (maybe waterproof/dustproof) then optical link may be handy.. but don't use it all the time, use optical link to transmit wireless channel/key and then switch to wifi/bt/nrf2401 link I think the optical "wake from sleep" signal, followed up by nrf2401 is probably best for most purposes, as you note. --------- I'm not sure if "securely talk" is super relevant. Just "talk" is fine, because wireless is... well... wireless. Its about convenience. (I know IrDA nominally is "more secure" than Radio since its shorter range, but... like NFC there's still security concerns IMO). But what if 10kB is all you need to transmit (~1 to 2 seconds of IrDA 115,200 baud, and just a fraction of a second if you implement 1Mbit, 4Mbit or 16Mbit IrDA), that's more than enough to dump an environmental sensor log (ex: ATTiny only has like 32kB of Flash storage, so your entire memory dump is only going to be 30ish kB. Smaller ATTiny4 has only 4kB). Something like... those E-Reader price tags probably fits within 20kB or so (https://www.opticonusa.com/products/electronic-shelf-labels/ee-153r.html https://www.opticonusa.com/products/electronic-shelf-labels/... is 152x152 pixels monochrome, or ~20,000 pixels). So the entire image would in fact fit within a fraction-of-a-second IrDA (albeit 1Mbit IrDA, rather than the default 115.2kBit IrDA). EDIT: Seems to be a part like: https://www.digikey.com/en/products/detail/pervasive-displays/E2154CS0C1/14825316 https://www.digikey.com/en/products/detail/pervasive-display... So if the infrared communication can "do it all", why even bother with a "Infrared to wakeup, then Radio to send/recv" kind of protocol? Just send the whole damn message over IrDA. ----------- It seems like the sweet spot for IrDA / IR is for small (less than 50kB) messages with simple control schemes. From remote controls (just 8 bytes or so), to maybe log dumps (30kB), to simple images. That way, you're not actually having an "extended" infrared session. Its something that's done near instantly when you point-and-shoot the infrared signal to the thing. IE: The IR-receiver just "never sleeps", at 0.075mA of current, its around the leakage current of some batteries, so there's no point making a sleep circuit. When it receives an IrDA message, you can have a quick session (Hey, are you X123152 device? Yeah I'm X123152 device. [insert cryptographic security here] Please send me your logs. Okay, here's a logdump: [30kB data dump at 1Mbit]. Hey, resend blocks #45, #99, #5555, those were in error. Okay, here's a resend: [resent blocks]. Etc. etc.). At 1 megabaud or 4 megabaud, this all can be done in less than 10 milliseconds, in apparent instant speeds to a human.