[<<][thermostat][>>][..]
Thu Feb 1 19:02:35 EST 2018

UDP receiver

Set up an UDP receiver in Erlang.  I'm going to likerly need this some
other time, so just go ahead and figure out how to do it.

It's actually very simple:

root@zoo:~# socat exec:temper-poll UDP4-DATAGRAM:10.1.3.97:2001

root@beaglebone:~# erl
Erlang/OTP 19 [erts-8.2.1] [source] [async-threads:10] [kernel-poll:false]

Eshell V8.2.1  (abort with ^G)
1> gen_udp:open(2001).
{ok,#Port<0.224>}
2> receive X -> X end.
{udp,#Port<0.224>,
     {10,1,3,2},
     39591,
     "Found 7 devices\nDevice #0: 16.4°C 61.6°F\nDevice #1: 15.4°C 59.7°F\nDevice #2: 16.9°C 62.5°F\nDevice #3: 16.6°C 61.9°F\nDevice #4: 17.9°C 64.3°F\nDevice #5: 15.8°C 60.4°F\nDevice #6: 18.1°C 64.6°F\n"}





[Reply][About]
[<<][thermostat][>>][..]