Vera and Moteino USB as Gateway



  • I've had a Vera 3 for some time but I am new to the Arduino world and was trying to get a Moteino USB to act as my Vera plug-in gateway. The Moteino has no sensors on it. From what i can tell, the Vera refuses to allow my access to the USB port.

    I have the plugin files uploaded to Vera, a device is created (with Luuap startup failure). In advanced, the com failure is (1)
    and Vera insists I choose a serial port. Been through the Vera serial port dance, unplug wait for reload, etc. But, no luck.

    I've stayed up till the wee hours for enough nights trying to get this to work that my wife thinks I have a girlfriend named "Vera" .I would really appreciate some guidance with how to proceed.

    Here is the gateway sketch from the Vera plugin page:

    /**
    * The MySensors Arduino library handles the wireless radio link and protocol
    * between your home built sensors/actuators and HA controller of choice.
    * The sensors forms a self healing radio network with optional repeaters. Each
    * repeater and gateway builds a routing tables in EEPROM which keeps track of the
    * network topology allowing messages to be routed to nodes.
    *
    * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
    * Copyright (C) 2013-2015 Sensnology AB
    * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
    *
    * Documentation: http://www.mysensors.org
    * Support Forum: http://forum.mysensors.org
    *
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * version 2 as published by the Free Software Foundation.
    *
    *******************************
    *
    * DESCRIPTION
    * The ArduinoGateway prints data received from sensors on the serial link.
    * The gateway accepts input on seral which will be sent out on radio network.
    *
    * The GW code is designed for Arduino Nano 328p / 16MHz
    *
    * Wire connections (OPTIONAL):
    * - Inclusion button should be connected between digital pin 3 and GND
    * - RX/TX/ERR leds need to be connected between +5V (anode) and digital pin 6/5/4 with resistor 270-330R in a series
    *
    * LEDs (OPTIONAL):
    * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs
    * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved
    * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly
    * - ERR (red) - fast blink on error during transmission error or recieve crc error
    *
    */
    
    // Enable debug prints to serial monitor
    #define MY_DEBUG
    
    
    // Enable and select radio type attached
    // #define MY_RADIO_NRF24
    #define MY_RADIO_RFM69
    
    // Set LOW transmit power level as default, if you have an amplified NRF-module and
    // power your radio separately with a good regulator you can turn up PA level.
    // #define MY_RF24_PA_LEVEL RF24_PA_LOW
    
    // Enable serial gateway
    #define MY_GATEWAY_SERIAL
    
    // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
    #if F_CPU == 8000000L
    #define MY_BAUD_RATE 115200
    #endif
    
    // Enable inclusion mode
    #define MY_INCLUSION_MODE_FEATURE
    // Enable Inclusion mode button on gateway
    //#define MY_INCLUSION_BUTTON_FEATURE
    
    // Inverses behavior of inclusion button (if using external pullup)
    //#define MY_INCLUSION_BUTTON_EXTERNAL_PULLUP
    
    // Set inclusion mode duration (in seconds)
    #define MY_INCLUSION_MODE_DURATION 60
    // Digital pin used for inclusion mode button
    //#define MY_INCLUSION_MODE_BUTTON_PIN  3
    
    // Set blinking period
    #define MY_DEFAULT_LED_BLINK_PERIOD 300
    
    // Inverses the behavior of leds
    //#define MY_WITH_LEDS_BLINKING_INVERSE
    
    // Flash leds on rx/tx/err
    // Uncomment to override default HW configurations
    //#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
    //#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
    //#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED
    
    #include <MySensors.h>
    
    void setup()
    {
        // Setup locally attached sensors
    }
    
    void presentation()
    {
        // Present locally attached sensors
    }
    
    void loop()
    {
        // Send locally attached sensor data here
    }
    

    Here is some info about the Vera serial ports from a putty session.

    root@MiOS_30011150:~# ls usb
    Bus 001 Device 001: ID 1d6b:0002
    Bus 002 Device 001: ID 1d6b:0001
    Bus 002 Device 003: ID 0403:6015
    root@MiOS_30011150:~# dmesg | grep tty*
    Kernel command line:  console=ttyS1,57600 board=NA900 rootfstype=squashfs,jffs2
    console [ttyS1] enabled
    serial8250: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A
    serial8250: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A
    ra_nand_probe: alloc 7f8, at 87841000 , btt(878415f8, 200), mtd:87841000
    eth0: AR8236 switch driver attached.
    rtc-s35390a 0-0030: setting system clock to 2017-03-23 14:54:59 UTC (1490280899)
    input: gpio-buttons as /devices/platform/gpio-buttons/input/input0
    Button Hotplug driver version 0.4.4
    JFFS2 notice: (483) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 6 of xref (0 dead, 0 orphan) found.
    root@MiOS_30011150:~# dmesg dmesg > /tmp/dmesg-pre
    root@MiOS_30011150:~# dmesg > /tmp/dmesg-post
    root@MiOS_30011150:~# diff -u /tmp/dmesg-pre /tmp/dmesg-post
    --- /tmp/dmesg-pre
    +++ /tmp/dmesg-post
    @@ -196,3 +196,4 @@
     usb 2-2: USB disconnect, address 3
     usb 2-2: new full speed USB device using rt3883-ohci and address 4
     usb 2-2: USB disconnect, address 4
    +usb 2-2: new full speed USB device using rt3883-ohci and address 5
    root@MiOS_30011150:~# tail -f /var/log/cmh/LuaUPnP.log | grep Arduino
    29822 root      1672 S    grep Arduino
    29822 root      1672 S    grep Arduino
    29822 root      1672 S    grep Arduino
    10	03/23/17 12:23:08.423	Device_LuaUPnP::LoadDeviceDoc 78 file D_Arduino1.xml size 1034 result 0 <0x2ab21000>
    10	03/23/17 12:23:08.423	Device_LuaUPnP::LoadDeviceDoc 78 file /etc/cmh-ludl//D_Arduino1.xml finished <0x2ab21000>
    25	03/23/17 12:23:09.287	JobHandler_LuaUPnP::ParseAllImplementations parsed I_Arduino1.xml <0x2ab21000>
    10	03/23/17 12:23:09.294	Device_LuaUPnP::MatchupImplementations device 78 using implementation: I_Arduino1.xml with 9 services <0x2ab21000>
    		luup.log("Arduino plugin: loading library L_Arduino ...")
    		package.loaded.L_Arduino = nil
    		p = require("L_Arduino")
    		if (package.loaded.L_Arduino == nil)
    			luup.log("Arduino plugin: plugin is not installed correctly. Library L_Arduino cannot be loaded.", 1)
    			luup.task("Plugin not correctly installed", 2, "Arduino plugin", -1)
    		luup.log("Arduino plugin: library L_Arduino loaded")
    function SArduino_arduino1_SendCommand_job(lul_device,lul_settings,lul_job)
    function SArduino_arduino1_SetUnit_job(lul_device,lul_settings,lul_job)
    function SArduino_arduino1_StartInclusion_job(lul_device,lul_settings,lul_job)
    function SArduino_arduino1_StopInclusion_job(lul_device,lul_settings,lul_job)
    25	03/23/17 12:23:18.575	LuImplementation::StartLua device: 78 file:I_Arduino1.xml startup:startup pLuaInterface: 0xa29bb0 ip:  port 0 protocol: (null) <0x2b455680>
    25	03/23/17 12:23:18.576	LuImplementation::StartLua running startup code for 78 I_Arduino1.xml <0x2b455680>
    50	03/23/17 12:23:18.576	luup_log:78: Arduino plugin: loading library L_Arduino ... <0x2b455680>
    50	03/23/17 12:23:18.617	luup_log:78: Arduino plugin: library L_Arduino loaded __LEAK__ this:16384 start:2224128 to 0xd13000 <0x2b455680>
    50	03/23/17 12:23:18.618	luup_log:78: Arduino: urn:upnp-arduino-cc:serviceId:arduino1,PluginVersion, 1.5, 78 <0x2b455680>
    50	03/23/17 12:23:18.618	luup_log:78: Arduino: Trying for a serial connection <0x2b455680>
    01	03/23/17 12:23:18.619	luup_log:78: Arduino: Serial port not connected. First choose the serial port and restart the lua engine. <0x2b455680>
    01	03/23/17 12:23:18.619	luup_log:78: Arduino: Choose the Serial Port <0x2b455680>
    01	03/23/17 12:23:18.635	LuImplementation::StartLua running startup code for 78 I_Arduino1.xml failed <0x2b455680>
    

  • Admin

    @kincaidj001 said in Vera and Moteino USB as Gateway:

    usb 2-2: USB disconnect, address 3
    usb 2-2: new full speed USB device using rt3883-ohci and address 4
    usb 2-2: USB disconnect, address 4
    +usb 2-2: new full speed USB device using rt3883-ohci and address 5

    If you are adventurous, you need to modify /etc/modules.d/60-usbserial to claim the Moetino USB device during boot up and then configure serproxy.conf to recognize the Moetino VID/PID combo. I would like to provide precise instructions but Vera prefers that their customers ask for help doing this. So, you should send an email to support@getvera.com after configuring remote technical support and they will configure the port for you.

    FEB 07, 2017 | 10:53AM PST
    Alex Sescu replied:
    Hello Bruce.

    The fixes are too complex for end-users and we don’t recommend our customers to SSH into their units because any damage done to the units via SSH will void support requests.

    You should ask your customers to send us an email to support@getvera.com whenever they >encounter this issue and we will gladly help them.

    Thank You.

    Regards,

    Alex Sescu ▾ Senior Customer Care Advocate
    Vera Control, Ltd. ▾ Smarter Home Control
    www.getvera.comsupport@getvera.com ▾ +1 (866) 966-2272



  • @blacey

    Thank you, that's what I thought. I saw your handle pop up on all kinds of discussions about this. But, I though i would try to get the Moteino to be recognized. So, I'm going to go with one of the plain vanilla methods (Serial or Ethernet). Just be sure, will the Vera open up the USB by using the correct (MySensors) serial method or is it locked up anyway?


  • Admin

    @kincaidj001 If you use an AVR with a USB Vid/Pid (e.g. Arduino Nano with built-in FTDI), it will automatically recognize the USB port. For Ethernet, it is a non issue because the Vera will not communicate with the gateway over USB/Serial so you can use any board compatible with the W5100 Ethernet module.

    That said, I encourage you to simply ask the Vera Support folks to tweak your Vera config to recognize the Moetino Vid/Pid combo. I figured it out for the MySensors SenseBender Gateway on a Vera 3 so I am 100% confident that they can configure it so it will work.



  • Hello,
    I realize this is an old thread, but I'm hoping someone can help with the 'tweaks' mentioned above. I followed @blacey 's advise and contacted Vera support. So far they have basically told me to pound sand, stating they don't support third party plug-ins. They did ask for more info about the Motieno VID/PID combo that needs to be recognized though. I responded saying I am only asking for help getting my Vera Edge to recognize a USB device plugged into it and referred them to this thread. They have not responded for several days. Hopefully they will get back to me, but it isn't an encouraging start. They've been very good to me on other issues in the past. Any info on what needs to be changed to get Vera to recognize the Motieno device would be very helpful.

    As background, I've been running an Arduino Nano-based gateway for several years but my Vera periodically loses the serial port configurations. I've read that is likely due to the nano being a clone so I decided to upgrade to sensebender to tidy things up and hopefully improve reliability. I know I could add an ethernet board and be done with it, but I'd prefer to connect the gateway via serial port if I can get it to work.

    TIA


Log in to reply
 

Suggested Topics

  • 6
  • 1
  • 1
  • 2
  • 1

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts