UART Buffer is not containing data, while from other end it is ensure data is being written every second



  • In Omega2, firmware version: latest firmware as of now 18-May-2018,
    While trying to read data from either ttyS1 or ttyS0 at the baud rate speed of 115200, using python programming language.

    UART Buffer is not containing data, while from another end it ensures data is being written every second.

    Verified each connection multiple times, even if I use to read data directly from input source other than omega I am able to read, but through omega, it is showing blank UART buffer of both ttyS1 ttyS0. also checked with pyserial--> serial.inWaiting() it is also giving 0 always.

    Please help me we have ordered in bulk for our organization from onion of omega2.



  • @Arshad-Alam On Omega2(+) UART0 (ttyS0) is used by the Serial Console / Terminal. You can check it:
    Connecting to the Omega’s Command Line >> Connecting via Serial
    UART1 (ttyS1) is free for use. You can check it: Communicating with Serial Devices

    I'm afraid you have some hardware connection problem or something wrong in your Python code.



  • @György-FarkasI think you didn't get my problem, I am facing it with both ttyS1..
    you have write everything in against of what i written.

    I have already mentioned that we have checked my connection a lots of time, first of all we are organization not an individual, so i have checked it at various level i am getting data other than ttyS1 but not through ttyS1 of omega2, i think you should read my issue once again...



  • @Arshad-Alam said in UART Buffer is not containing data, while from other end it is ensure data is being written every second:

    Verified each connection multiple times, even if I use to read data directly from input source other than omega I am able to read, but through omega, it is showing blank UART buffer of both ttyS1 ttyS0.

    You have already verified the "other" side. I wrote about how could you check the Omega side.

    You did not write anything about your serial hardware connection and your Python code.
    Maybe there is a guy here with some paranormal and psychic abilities - a clairvoyant - who can see them and will help you surely.

    Many thanks for your down vote! :-)

    I think you have some hardware connection problem or something wrong in your Python code.
    Good luck!



  • @György-Farkas Sorry to say but your phsyco reply force me to give you python code
    python code:
    from serial import Serial
    from time import sleep
    ser = Serial('/dev/ttyS1', baudrate=115200, timeout=1)
    while True:
    ser.readline()
    sleep(0.5)

    and do not worry about the connection at the hardware level , we have an entire team for that each and everyone verify and for your information please with the same connection and the older omega with old firmware 0.1.9 I am able to do so i.e. able to read data from ttyS1 using the same code and same hardware circuit. and also would like to share you that we do not use the sold wire, we have completely designed PCB in full professional way.

    we have done a lot of IOT project on serial and UART ONCE AGAIN I WOULD LIKE TO SAY YOU/TEAM I AM NOT INDIVIDUAL WE ARE ORGANIZATION, and we can't share you entire code/hardware screenshot.

    I will surely give you upvote and appreciate if you had given me the solution with understanding my issue, other than being first to reply on the query.

    Thank you very much, if you will or not will able to give my solutions.

    but would like to share you we have to return entire order to onion omega if this is not get resolved because it is all about our business loss.

    Please if there is anyone else from omega who can help me.!!



  • @Arshad-Alam
    Omega2+ v0.2.0-b186
    python 2.7.14-5
    python-pyserial 3.1.1.1

    FTDI232 USB-to-3.3V TTL serial module TX >> direct connection >> Omega2+ RX1
    GND >> direct connection >> GND

    from serial import Serial
    from time import sleep
    ser = Serial('/dev/ttyS1', baudrate=115200, timeout=1)
    while True:
        ser.readline()
        sleep(0.5)
    

    This Python code is working. What about your top secret serial HW connection?

    You wrote:

    ... the older omega with old firmware 0.1.9 ...

    Are you talking about the previous / "the original" Omega?


    BTW I do not expect your up vote or your thanks.
    We are talking about your problem - so a simple informative response would be more than enough.



  • @György-Farkas hey, first of all bunch of thanks for keeping continue with me... and not keeping quite...

    As I said in my original comment and in the last reply, we have ordered big from omega so definitely we have older and newer version both.
    We have tried on both.
    We have tried a lot in different way, some of the omega is running perfectly from ordered one but on some of the pieces of omega we found ttyS1 is remains empty And some of the pieces omega is working but reading from buffer is seem like sticking somewhere like hanging. we (I.e. entire team) we Check all these
    with the same hardware connection and with the same details I shared AS you were forcing and try to show we organisations are idiot who do not know about simple python coding

    You are replying continuously in such a way that you do not want to support your customer/organisation, your reply is showing clearly.
    And if you are hired for omega community talk let’s come on private conversation through email I am gonna add my CTO with your boss about you and your behaviour.

    Because Instead of helping, who are you... ?? Who is continue with your comment in a tont way Perhaps you do not know company has their own copyrights and cant share you ENTIRE PCB means we can’t. if you do have solution then please else SHUT YOUR MOUTH.

    It seems you are a street boy, who only know to pass comment and tont do you know professsionalism, I don’t think so.

    And please I Really need help because everything is fine other than buffer responding in omega so please if you do have solutions, then please else please I DO NOT NEED YOUR REPLY, else I will return all the defected pieces even entire order back to omega JUST BECAUSE OF YOUR BEHAVIOUR AND NO SOLUTIONS.
    Thank you



  • Hey is there anyone else who can listen to me and can give solution with manner.

    I have working python code, and working circuit which is going to be delivered to be our client AS an IOT device,
    We are organisation and ordered huge amount of omega, and my team found some of the omega is not responding properly even by upgrading latest firmware.
    Python code is working fine and circuit too with some of the omega2 but not working with rest of the.

    Issue is ttyS1 always show as blank when I try to read it through same python code and also
    Some of the pieces of omega2 is responding but in such manner like buffer “ttyS1” is not responding properly and seems like it hanging.

    While entire omega is empty, no file no extra space occupied by us other than installing
    Python-light and pyserial
    I will try to share Some screenshots to you guys so that any professional guy can help me and my team from this.

    Thanks



  • @an.arshadali said in UART Buffer is not containing data, while from other end it is ensure data is being written every second:

    While entire omega is empty, no file no extra space occupied by us other than installing
    Python-light and pyserial

    PySerial works with the full version of Python 2.7 only.

    Many thanks for your second down vote too! :-)



  • @György-Farkas said in UART Buffer is not containing data, while from other ends it ensures data is being written every second:

    PySerial works with the full version of Python 2.7 only.

    See Mr. Farkas, once again you treated me in such a way that I or our organization team does not know anything. but Thanks you, we need no reply from your side.
    but for your kind information, i as myself has expertise in python, I can and have the abilities to customize any python package.

    pyserial also works with python-light and we have delivered and made so many project.

    for now i do not want to argue with you as i am not individual i am representing my company here, and looking for buffer solution.

    please thanks for your reply, you are totally psycho i do no need of your reply. thank you very much.



  • I think maybe this will help you guys to help me out, I am not using any language, for now, I avoid every language and following the instruction
    UART Testing Basic Level as per Omega guidance link:: https://docs.onion.io/omega2-docs/uart1.html

    and I found it fails as I had said earlier and as I was saying in my above queries, now please any professional guy there who can help me, please.
    screenshot attached..!!
    0_1526728663074_ttyS1_issue.png



  • i have a similar problem with omega2+ (Ω-ware: 0.2.0 b177) and arduino dock2, using python2.7 to send and read data from /dev/ttyS1.

    in python the serial port set as :

    ser = serial.Serial('/dev/ttyS1', 9600, timeout=2)

    and on the dock2 the serial port set as:

    Serial.begin(9600);

    The script runs fine for a while BUT:

    /dev/ttyS1 will randomly lock up with no reply from the dock

    or the python script freezes at:

    File "/usr/lib/python2.7/site-packages/serial/serialposix.py", line 468, in read
    'device reports readiness to read but returned no data '

    I get around the problem by issuing gpio reset command and restarting the python script:

    python snippet:

          print("error: Arduino offline - restarting")
          subprocess.call(["gpioctl","dirout-high","19"])
          subprocess.call(["gpioctl","dirout-low","19"])
          ser.close()
          python = sys.executable
          os.execl(python, python, * sys.argv)
          exit()
    

    which allows the script to run normally (the python script is a cron job that runs every 1/2 hr and takes a minute to complete). This reset happens ~ 1 out 8 times the script is run. (much too often!)

    i have no ability sniffing /dev/ttyS1 and running the python script , as /dev/ttyS1 cannot be opened by 2 processes AT THE SAME TIME.



  • Does the problem still exist when you lower your baud rate to 19200 or 9600?



  • Update:

    My onion2+ uses a 1GB sd card as a root overlay.

    for some unknown reason, 3 "invalid encoding" files with zero byte length are written on the root fs, "/". I have no idea what process creates these 3 files.

    When these these files are present they interfere with /dev/ttyS1 communications and affect both python scripts and avrude write operations to the arduino dock2.

    to correct this problem, I remove the SD card from the onion, fsck it in a laptop, (which is clean, without issue), and use nautilus to delete the 3 files from the SD card.

    Restarting the onion with the files removed, serial communications to /dev/ttyS1 returns to normal.



Looks like your connection to Community was lost, please wait while we try to reconnect.