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. Hardware
  3. serial gateway overrun error ?

serial gateway overrun error ?

Scheduled Pinned Locked Moved Hardware
6 Posts 3 Posters 686 Views 3 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.
  • rozpruwaczR Offline
    rozpruwaczR Offline
    rozpruwacz
    wrote on last edited by
    #1

    Hi all,
    I just realised that i have a problem with my serial gateway communication to controller. My gateway is an atmega328p based custom board and my controller is raspberry pi 3. Gateway is connected to uart pins (gpio14, gpio15) of the pi, and the baudrate is 38400. This works most of the times, but sometimes i can see in the logs that only part of the message is received by the pi. Below the output of the miniterm.py program:
    11;1;1;0;3;0 -> OK
    11;1;1;0;2;0 -> OK
    1␀1;1;1;011;1;1;0;2;1 -> NOT OK
    when that happens the overrun error count of the ttyS0 increases by one:
    sudo cat /proc/tty/driver/serial
    serinfo:1.0 driver revision:
    0: uart:16550 mmio:0x00000000 irq:166 tx:19902 rx:358134 oe:1046 CTS

    So it seems that it is rather a problem with interrupt handling (the overrun error happens when the buffer is full and new byte comes in), and not with the hardware connection.

    Does anyone had the same problem ? Is my assumptions that the problem is related to interrupt handling correct ?

    YveauxY 1 Reply Last reply
    0
    • rozpruwaczR rozpruwacz

      Hi all,
      I just realised that i have a problem with my serial gateway communication to controller. My gateway is an atmega328p based custom board and my controller is raspberry pi 3. Gateway is connected to uart pins (gpio14, gpio15) of the pi, and the baudrate is 38400. This works most of the times, but sometimes i can see in the logs that only part of the message is received by the pi. Below the output of the miniterm.py program:
      11;1;1;0;3;0 -> OK
      11;1;1;0;2;0 -> OK
      1␀1;1;1;011;1;1;0;2;1 -> NOT OK
      when that happens the overrun error count of the ttyS0 increases by one:
      sudo cat /proc/tty/driver/serial
      serinfo:1.0 driver revision:
      0: uart:16550 mmio:0x00000000 irq:166 tx:19902 rx:358134 oe:1046 CTS

      So it seems that it is rather a problem with interrupt handling (the overrun error happens when the buffer is full and new byte comes in), and not with the hardware connection.

      Does anyone had the same problem ? Is my assumptions that the problem is related to interrupt handling correct ?

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

      @rozpruwacz what radio are you using, and if nrf24, do you have message queuing enabled on the gateway?

      http://yveaux.blogspot.nl

      1 Reply Last reply
      0
      • rozpruwaczR Offline
        rozpruwaczR Offline
        rozpruwacz
        wrote on last edited by
        #3

        i'm using rfm69 but this is not the problem with the radio, because I use ack'ing. The node will keep resending every 2 seconds when no ack recevied. When the problem happens, for example when i turn lights off and the controller does not get the status update which should be sent by the node, I see in the logs that the status update was received by the gateway but on the rpi side i see only first byte of that message.

        mfalkviddM 1 Reply Last reply
        0
        • rozpruwaczR rozpruwacz

          i'm using rfm69 but this is not the problem with the radio, because I use ack'ing. The node will keep resending every 2 seconds when no ack recevied. When the problem happens, for example when i turn lights off and the controller does not get the status update which should be sent by the node, I see in the logs that the status update was received by the gateway but on the rpi side i see only first byte of that message.

          mfalkviddM Offline
          mfalkviddM Offline
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @rozpruwacz how is the custom board clocked? Maybe the uart timing is slightly inaccurate?

          rozpruwaczR 1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            @rozpruwacz how is the custom board clocked? Maybe the uart timing is slightly inaccurate?

            rozpruwaczR Offline
            rozpruwaczR Offline
            rozpruwacz
            wrote on last edited by
            #5

            @mfalkvidd it is clocked from the internal oscillator and works on 8MHz. The clock may be a problem, but would it cause overrun errors in the kernel driver ? I now connected the gateway through the pl2303 uart<->usb converter and I'm waiting to see of it helps.

            mfalkviddM 1 Reply Last reply
            0
            • rozpruwaczR rozpruwacz

              @mfalkvidd it is clocked from the internal oscillator and works on 8MHz. The clock may be a problem, but would it cause overrun errors in the kernel driver ? I now connected the gateway through the pl2303 uart<->usb converter and I'm waiting to see of it helps.

              mfalkviddM Offline
              mfalkviddM Offline
              mfalkvidd
              Mod
              wrote on last edited by
              #6

              @rozpruwacz I guess it shouldn't. Maybe if one incoming byte is treated as two, but the kernel should still be able to process that I think. It would decode the byte incorrectly, but it shouldn't cause an overrun.

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


              22

              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