Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. [SOLVED] Unable to write data to serial port on pi3

[SOLVED] Unable to write data to serial port on pi3

Scheduled Pinned Locked Moved General Discussion
3 Posts 2 Posters 806 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by Yveaux
    #1

    Hello everyone,

    I'm trying to create a custom controller on a pi 3. I have some really specific need.

    I have build MySensors using the following command :

    ./configure —my-debug=enable —my-gateway=serial --my-serial-pty=/dev/ttyGateway --my-serial-is-pty --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-rf24-irq-pin=13
    

    Everything is working fine, the radio is working and I can receive data from nodes with a static ID.
    What I want to do is to handle ID request from nodes and to simply send data to nodes. The issue is that I can't write to the serial port.

    When I try to do :

    sudo echo "255;0;3;0;4;4" > /dev/ttyGateway
    

    I get : "Permission not granted"

    When I do : ls -l /dev/ttyGateway

    lrwxrwxrwx 1 root root 10 mars   4 13:51 /dev/ttyGateway -> /dev/pts/5
    

    In principle it should work with no issue, right ?

    My question is : How can I send data by writing to the serial port ?

    YveauxY 1 Reply Last reply
    0
    • ? A Former User

      Hello everyone,

      I'm trying to create a custom controller on a pi 3. I have some really specific need.

      I have build MySensors using the following command :

      ./configure —my-debug=enable —my-gateway=serial --my-serial-pty=/dev/ttyGateway --my-serial-is-pty --my-rf24-ce-pin=22 --my-rf24-cs-pin=24 --my-rf24-irq-pin=13
      

      Everything is working fine, the radio is working and I can receive data from nodes with a static ID.
      What I want to do is to handle ID request from nodes and to simply send data to nodes. The issue is that I can't write to the serial port.

      When I try to do :

      sudo echo "255;0;3;0;4;4" > /dev/ttyGateway
      

      I get : "Permission not granted"

      When I do : ls -l /dev/ttyGateway

      lrwxrwxrwx 1 root root 10 mars   4 13:51 /dev/ttyGateway -> /dev/pts/5
      

      In principle it should work with no issue, right ?

      My question is : How can I send data by writing to the serial port ?

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @sapher said in Unable to write data to serial port on pi3:

      sudo echo "255;0;3;0;4;4" > /dev/ttyGateway

      Try

      sudo echo "255;0;3;0;4;4" | sudo tee /dev/ttyGateway > /dev/null
      

      or make yourself superuser:

      sudo su
      echo "255;0;3;0;4;4" > /dev/ttyGateway
      

      http://yveaux.blogspot.nl

      1 Reply Last reply
      1
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @Yveaux said in Unable to write data to serial port on pi3:

        Thank you dear Sir, both of your solution work. Amazing.
        I hope this will help others. Cause I can sense that this is pretty basic Linux stuff. But I was stuck for days on that. Thank you :+1:

        1 Reply Last reply
        1
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        26

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular