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 1.0k 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 ?

    Y 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 ?

      Y Offline
      Y 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

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        18

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        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