RFlink on the RPi, and linking the doorbell to the mobile phone

I've now installed the RFLink + Arduino on the RPi rather than on my Mac. Makes sense, the RPi is always on, always connected, and is also running the NodeRed and other Home Automation software.

So - plugged the Arduino into the RPi. Now I need to get the RPi to provide a USB-Serial interface... Then I can point the NodeRed SerialIn/Out nodes at it.

First, use lsusb to determine what the USB info is for the device...

pi@server:~ $ lsusb
Bus 001 Device 006: ID 2341:0042 Arduino SA Mega 2560 R3 (CDC ACM)
Bus 001 Device 004: ID 174c:55aa ASMedia Technology Inc. ASMedia 2105 SATA bridge
Bus 001 Device 005: ID 1058:1021 Western Digital Technologies, Inc. Elements 2TB
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Huzzah! Now let's sort out the support in the OS...

pi@server:~ $ sudo modprobe usbserial vendor=2341 product=0042

And have a look to see if that worked...

pi@server:~ $ dmesg
[1462389.459100] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[1462389.612973] usb 1-1.5: New USB device found, idVendor=2341, idProduct=0042
[1462389.612987] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=220
[1462389.612995] usb 1-1.5: Manufacturer: Arduino (www.arduino.cc)
[1462389.613003] usb 1-1.5: SerialNumber: 556393135333515070B1
[1462389.751184] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
[1462389.752050] usbcore: registered new interface driver cdc_acm
[1462389.752055] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[1463214.939071] usbcore: registered new interface driver usbserial
[1463214.939161] usbcore: registered new interface driver usbserial_generic
[1463214.939244] usbserial: USB Serial support registered for generic

Looks like it did... Just check with the /dev approach...

pi@server:~ $ ls -l /dev/ttyACM0

crw-rw---- 1 root dialout 166, 0 Dec 16 15:45 /dev/ttyACM0


Marvellous! And now I'm going to link the front doorbell up to send a text to a mobile phone, using NodeRed and my Twilio test account...

NodeRed Flow for Friedland bell to SMS
Here we go...
  • RFLink Input - a SerialIn node, reading from the Serial-USB device discovered above
  • RFLink Parser - a Function node, most of the content of which is nicked from Scargill, because it saves typing a silly ol' JS
  • RFLink Message Router - a Router node, which selects for two outputs
    1. Drayton thermostat (in case I want to mess with the neighbour's heating hehe)
    2. Friedland EVO bell - this is the thing we're interested in
  • Friedland Bell Signal - simple Function to build topic/payload for MQTT message announcing the bell has rung
  • Friedland Bell To SMS - same thing, except for it's a Twilio-style payload
  • SMS to my/Jen's phone - Twilio nodes sending a simple SMS to our phones
This is very cool - we've already made it to the front door at least once when the bell wasn't audible, because a text was sent. Nice. Now I need to rig up a better announcer we can carry around that runs off the MQTT publish. That would be clever - but what? A siren? A light? A groovy LCD display???

Comments

Popular posts from this blog

Replacing Coffee Machine Pump (Dualit Espressivo)

Multiple SHT30 sensors on a single I2C bus with Sonoff-Tasmota

NodeMCU + Tasmota code + SHT30