Connect raspberry and arduino nano with USB



  • Hi,
    Am a newbie and lost in connecting my rpi with arduino via usb.
    I can upload sketches to the arduino after installing a new driver and could imagine I got a fake arduino not able to connect?
    However plug in the arduino to rpi does not show up a new /dev/tty device.
    Not fully clear this is how it works anyway so 2 questions.
    Can I use a standard usb cable to connect or do I have to use serial pins on arduino side?
    Is there an issue connection non fdti fake arduinos with raspberry.
    Any links or pictures of wiring would be welcome as I spend a day in figuring out why it's not working and bit frustrated 😞
    My goal is to use my sensors on arduino to connect via rf with domoticz.
    Domoticz running well already and also tha arduino side works well but not the connection.
    Million thanks, Marcus



  • The USB connection between the RPi and the Nano is known to make problems. Just use the Pi's UART. Connect RX of the Pi with TX of the Arduino and vice versa. See https://github.com/openhab/openhab/wiki/Serial-Binding for using the Pi's UART with openHAB. Rock stable and easy.



  • @Jan-Gatzke said:

    https://github.com/openhab/openhab/wiki/Serial-Binding

    Thanks for your quick answer.
    I saw photos with weak descriptions and thought it works with a plain USB cable...
    As my RPI uses /dev/ttyAMA0 for my Razberry shield I thought that might cause conflicts or damage something using the same port for different hardware/channels.

    Will try this evening without using USB by directly connecting the PINs.
    Domoticz offers a mySensors USB and Ethernet plug-in only.
    Guess I have to use the standard serial plug-in then in Domoticz.

    Any tipps on this would be welcome because after trying one day having no success I really need a Success.
    Anyway a good news is I can use a cheaper Arduino Mini if the USB is not required 😉

    Used Hardware: Raspberry Modell B, RaZberry-Modul (/dev/ttyAMA0), Arduino Nano, nrf24l01



  • In this case you have to stick with the USB-Connection. You cannot connect two devices via the same UART.



  • OK - so back to the beginning.

    On my Mac I had the same issue but fixed it with installing this driver:
    http://plugable.com/drivers/prolific
    After that the Nano as well as my USB2Serial adapter wit Ardu Mini showed up and uploading sketches worked.
    However it says these are included in Linux and good to go but my RPI does not show new Ports in /dev/tty*

    Any idea how this can be fixed. Software missing burn a new boot loader on Arduino? Need a nano with different Chip?



  • What does tail /var/log/messages show just after plugging in the usb plug?



  • @Jan-Gatzke said:

    tail /var/log/messages

    With the nano an standard USB-cable:
    Jun 8 17:57:07 raspberrypi kernel: [34955.551271] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
    Jun 8 17:57:07 raspberrypi kernel: [34955.551312] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jun 8 17:57:07 raspberrypi kernel: [34955.551332] usb 1-1.2: Product: USB-Serial Controller
    Jun 8 17:57:07 raspberrypi kernel: [34955.551351] usb 1-1.2: Manufacturer: Prolific Technology Inc.
    Jun 8 18:16:02 raspberrypi kernel: [36090.724307] usb 1-1.2: USB disconnect, device number 5
    Jun 8 18:16:18 raspberrypi kernel: [36106.324117] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
    Jun 8 18:16:18 raspberrypi kernel: [36106.428007] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
    Jun 8 18:16:18 raspberrypi kernel: [36106.428048] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jun 8 18:16:18 raspberrypi kernel: [36106.428070] usb 1-1.2: Product: USB-Serial Controller
    Jun 8 18:16:18 raspberrypi kernel: [36106.428089] usb 1-1.2: Manufacturer: Prolific Technology Inc.

    With the serial usb connector and arduino mini:
    Jun 7 21:44:30 raspberrypi domoticz: Domoticz is starting up....
    Jun 7 21:44:30 raspberrypi domoticz: Domoticz running...
    Jun 7 21:44:33 raspberrypi kernel: [ 29.747891] warning: process `colord-sane' used the deprecated sysctl system call with 8.1.2.
    Jun 7 21:44:33 raspberrypi kernel: [ 29.935666] Adding 102396k swap on /var/swap. Priority:-1 extents:9 across:339964k SSFS
    Jun 8 08:30:56 raspberrypi kernel: [ 983.234640] usb 1-1.2: USB disconnect, device number 4
    Jun 8 17:57:07 raspberrypi kernel: [34955.448468] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
    Jun 8 17:57:07 raspberrypi kernel: [34955.551271] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
    Jun 8 17:57:07 raspberrypi kernel: [34955.551312] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jun 8 17:57:07 raspberrypi kernel: [34955.551332] usb 1-1.2: Product: USB-Serial Controller
    Jun 8 17:57:07 raspberrypi kernel: [34955.551351] usb 1-1.2: Manufacturer: Prolific Technology Inc.



  • This is my: /dev/tty*
    assuming AMA0 is my Razberry and not the USB. That's listed in Domoticz and works well since weeks.
    /dev/tty /dev/tty14 /dev/tty20 /dev/tty27 /dev/tty33 /dev/tty4 /dev/tty46 /dev/tty52 /dev/tty59 /dev/tty8
    /dev/tty0 /dev/tty15 /dev/tty21 /dev/tty28 /dev/tty34 /dev/tty40 /dev/tty47 /dev/tty53 /dev/tty6 /dev/tty9
    /dev/tty1 /dev/tty16 /dev/tty22 /dev/tty29 /dev/tty35 /dev/tty41 /dev/tty48 /dev/tty54 /dev/tty60 /dev/ttyAMA0
    /dev/tty10 /dev/tty17 /dev/tty23 /dev/tty3 /dev/tty36 /dev/tty42 /dev/tty49 /dev/tty55 /dev/tty61 /dev/ttyprintk
    /dev/tty11 /dev/tty18 /dev/tty24 /dev/tty30 /dev/tty37 /dev/tty43 /dev/tty5 /dev/tty56 /dev/tty62
    /dev/tty12 /dev/tty19 /dev/tty25 /dev/tty31 /dev/tty38 /dev/tty44 /dev/tty50 /dev/tty57 /dev/tty63
    /dev/tty13 /dev/tty2 /dev/tty26 /dev/tty32 /dev/tty39 /dev/tty45 /dev/tty51 /dev/tty58 /dev/tty7

    My assumption is that the Arduino should be listed here as an ttyACM1 or ttyUSB0 in addition.
    Resulting in being separately selectable in Domoticz assigning the mySensors PlugIn.



  • Strange. No idea why this does not woek, sorry.



  • No prob. Thanks for your help so far.
    In the meantime I prepared a second SD card with raspian. It works there. So it's something with my image but technically works.
    I now check a virgin Domoticz. If that works I reinstall instead spend the night searching for a solution.
    Many thanks for your help!



  • It seems the driver module for the ftdi is missing. You could have a look at the raspian installation (lsmod) and see which module is needed. Don't knew Domoticz, but perhaps you can just add this module.


Log in to reply
 

Suggested Topics

  • 1
  • 6
  • 2
  • 1
  • 5
  • 2

71
Online

11.4k
Users

11.1k
Topics

112.7k
Posts