Unable to connect to /dev/ttyUSB0 [Solved]



  • If I had any hair I would have pulled it all out trying to configure MySensors with HASS 🤷‍♂️

    I don't understand as I have it working fine in Domoticz configured as dev/ttyUSB0 so why can't HASS connect?!

    settings ini configuration.yaml are:

    mysensors:
    gateways:
    - device: '/dev/ttyUSB0'
    persistence file: '/home/homeassistant/.homeassistant/mysensors.json'
    baud_rate: 115200
    optimistic: false
    persistence: true
    retain: true

    It's been ages since I set this up in Domoticz, I do vaguely recall having issues but that might have just been detecting sensors.


  • Mod

    I remember something about adding user permissions to the serial port but I'm not entirely sure since I never used serial gw



  • Thanks @gohan !! Another google about accessing usb and found some detail about adding to the dialout group. So I did this:

    sudo adduser homeassistant dialout

    It doesn't work unless you reboot but its now connecting to the usb!! I'm getting other errors about my sensors now but this is progress at least! Thanks 🙂



  • @david-pinnock

    Did you solved it ? What did you do ? I have the same problem and I'm frustrated


  • Mod

    @kobipes doesn't his latest post describe exactly what he did?



  • @mfalkvidd
    Actually he did but under Hssio the "sudo" keyword is not acknowledged. Tried without this 'super user do' keyword but nothing



  • This post is deleted!


  • @kobipes said in Unable to connect to /dev/ttyUSB0 [Solved]:

    @mfalkvidd
    Actually he did but under Hssio the "sudo" keyword is not acknowledged. Tried without this 'super user do' keyword but nothing

    Hassio is different.

    1. Install SSH/Console addon (I don't remember which addon I used, I think both the console and ssh server worked)
    2. Connect via ssh client or using the addon you chose as root.
    3. Type 'hassio help' in the console
    4. One of the bountiful commands you should have seen listed, 'hassio host hardware', lists available hardware and what /dev/ they're under
    5. If you don't see the device listed or no idea which one it is, unplug run the command again plug in and repeat. Look for the item that disappears and returns.

    If smashing face onto keyboard at this point, check out the 'dmesg | grep tty' or 'dmesg | grep usb' and look for your device. If you don't see it after running either of those commands, proceed to start a fire in your immediate surroundings.

    1. By now you should have figured out what /dev/* your whatever is plugged into. If you haven't been consumed by the fire yet and know which /dev/ path your usb whateverthingy is under from dmesg, the magic fix is, in the console run:
    curl -d '{"devices": ["ttyAMA0"]}' http://hassio/homeassistant/options
    

    replace the ttyAMA0 with your device you want to have hassio make sweet bit-by-bit usb love with.

    Source: Google.com



  • This post is deleted!


  • @nitroburn thank for the detailed explanation but already tried what you suggested without success. After typing
    'hassio host hardware' I've got : "Error decoding json invalid character ':' after top-level value: 404: Not Foundc"

    0_1524427758321_ffe651db-b43a-49ab-9302-ead99d7a49b5-image.png

    also tried what you suggest with "dmesg | grep usb" and got :

    0_1524427942452_9c9d3feb-2725-4bb0-96aa-b23d4f948777-image.png

    as you can see, the usb port is : ttyUSB0 (exactly as typed in the attached configured file - see below) , so why the heck am I getting error in the config file ?! Where am I wrong ??

    This is the config file (written according to [link text](https://www.home-assistant.io/components/mysensors/ guidance) :

    0_1524428296671_6948ae83-14d3-4dbe-9cfa-78fb96a0bd27-image.png

    but I still get this error again and again :
    0_1524428452720_f845e667-d2b7-4e17-8b10-f1260a7edec1-image.png



  • googling of this problem (same error message) brought me to this link : link text

    but I can't see what am I doing different ? Does anybody have a clue ?


  • Mod

    Don't you have a spare esp8266 and make an ethernet gateway? At least to get the mysensors network working



  • @gohan Actually I have the ESP8266-12 and I'll give it a try also (at the same time, ordered the WizNET (W5100) Ethernet module and the ENC28J60 Ethernet module but it will take time until I'll get it) , just wanted to solve the problem with the serial gateway ... 😐



  • @gohan I thought that the esp8266 may be just a replacement to the WizNET (W5100) or the ENC28J60 (suggested in the mysensors instructions to built Ethernet / MQTT gateways). But from what I understand, upon your link you gave me, I don't see the nrf24 module connected to the ESP8266-12 , but the ESP8266-12 module solely.

    Note that I need the nrf24 to be a part of the Ethernet gateway in order to be able to communicate with the nodes


  • Mod

    What link? BTW look at the "connecting the radio" page, you will see how to wire the radio on all arduino boards



  • @gohan this : link text.
    I know how to connect the nrf to the arduino board but I don't know how to connect the esp8266-12 with the nrf and the arduino (it does not explained in the link).


  • Mod

    you don't need the arduino board on the gateway, the ESP8266 will be running the sketch and will use the NRF24 radio for the mysensors network and the wifi interface to talk to the controller



  • @gohan OK I see . I'll try it today. Thanks



  • This post is deleted!


  • Today, when I connected the arduino through the usb port in the raspberry pi 3, then entered the /dev directory, I saw this :
    0_1524933413755_a34f22b8-7f2e-40b3-9c1f-e72f6a410ea7-image.png

    Isn't that weird ? what is the "p" is doing there between the tty and the USB0 ? also tried accessing this "ttypUSB0" but still get an error



  • I am having the exact same issue as kobipes. I am also on hass.io and I have not been able to resolve it. I am using an Arduino Nano with the RF24l01 connected to a Pi using USB (ttyUSB0). No go, configuration errors as stated from your post.

    However when I use an Arduino Uno on ttyACM i managed to get it working as long as you cold boot the Pi during config changes.

    Any help will be really appreciated!


Log in to reply
 

Suggested Topics

  • 1
  • 17
  • 5
  • 3
  • 1

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts