Shop OBEX P1 Docs P2 Docs Learn Events
Raspberry Pi 3 serial dilemma, replace with many Propeller boards. — Parallax Forums

Raspberry Pi 3 serial dilemma, replace with many Propeller boards.

RsadeikaRsadeika Posts: 3,837
edited 2016-12-20 12:10 in General Discussion
In my new robot project I was trying to hook a Raspberry Pi 3 to my Activity Board. Things have changed with the new RPi 3 board.

The RPi UART is now -> /dev/ttyS0, the Bluetooth is now -> /dev/ttyAMA0. When you have the serial port disabled in configuration, the /dev/ttyS0 file disappears, so you cannot access it. Not sure what the Raspberry Pi people are up to. If you fall back to using an RPi 2 board with the new OS, the /dev/ttyAMA0 disappears, so you cannot access that either. I guess there is a way to beat the system, so to speak, but who wants to go through all the hassle to get there, and then do it again every time the system gets updated.

So, I guess my alternative is to add my other Propeller boards too the project, distribute the work load, and have the Activity Board act as the master, that should be simple enough to do, I guess.

I guess what I really need is a Propeller board with about 60 I/O pins, at least, maybe a meg of memory, at least, 16 COGs, at least, an active WiFi, an ADC component, and what else... oh, a useable user system to use all the components. Have I missed anything?

This is really getting to be frustrating, to say the least.

Ray

Comments

  • Ray,
    Check with Bill Henning and see if he has a solution with his Propeller PI Hat.
    Jim
  • Ray,

    I use a Raspi USB port, setup for serial communication with propeller boards, so
    that the serial port is not affected. I am using XBEEs for wireless communication.

    Nick
  • jmgjmg Posts: 15,173
    Rsadeika wrote: »
    The RPi UART is now -> /dev/ttyS0, the Bluetooth is now -> /dev/ttyAMA0. When you have the serial port disabled in configuration, the /dev/ttyS0 file disappears, so you cannot access it. Not sure what the Raspberry Pi people are up to.
    Why would anyone disable the serial port in config, if they intended to use it ?
    What do their forums say ? - if is this a real usage issue, I'd expect them to fix it - there will be some reason behind the change... Perhaps a Pi4 is being worked on, and needs more serial choices ?

  • Heater.Heater. Posts: 21,230
    Yeah, I'm not sure what the problem is here.

    Serial ports work fine on all Pi. Give or take a name change.
  • jmgjmg Posts: 15,173
    nglordi wrote: »
    I use a Raspi USB port, setup for serial communication with propeller boards, so
    that the serial port is not affected. I am using XBEEs for wireless communication.
    That sounds useful - what USB-UART choices does the Pi have, and what drivers are needed ?
    I see devices like the XR22804 or FT2234 can add 4 UARTS on one USB connector, so could give a better 'fan-out' to multiple Serial slaves.

  • Heater.Heater. Posts: 21,230
    I have never known a USB-serial adapter not work with the Pi.

    A neat thing is that you can arrange that a USB serial port always gets the same name in /dev as you unplug and replug it. You can even give specific devices meaningful names like "/dev/propeller".
    You just have to setup some udev rules.

    See hear for example:
    http://hintshop.ludvig.co.nz/show/persistent-names-usb-serial-devices/
  • I have never had a problem using a USB for a serial port, I want to use GPIO UART to connect to the Activity Board. This is where the drama is.
    Why would anyone disable the serial port in config, if they intended to use it ?
    If you have the serial port enabled, in config, then the port has a login sequence it goes through, for an external hook up to the Raspberry Pi UART.

    Previously, it was setup that once you disable the serial port, the login stuff was disabled, and you could use /dev/ttyAMA0 directly.

    Ray
  • jmgjmg Posts: 15,173
    Heater. wrote: »
    Yeah, I'm not sure what the problem is here.

    Serial ports work fine on all Pi. Give or take a name change.

    There is some chatter here around this...
    https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=138223

    Seems they believed they were forced to swap UARTS in order to support the Bluetooth, and that of course, has bitten them, as the UARTS are not interchangeable.
    Might have been smarter to patch the Bluetooth instead, to work with the available UART, which would have kept things standard.

    Still, it does sound like you can reverse the mapping in software, if you can tolerate losing Bluetooth. Ugh.

  • jmgjmg Posts: 15,173
    Rsadeika wrote: »
    If you have the serial port enabled, in config, then the port has a login sequence it goes through, for an external hook up to the Raspberry Pi UART.

    Previously, it was setup that once you disable the serial port, the login stuff was disabled, and you could use /dev/ttyAMA0 directly.

    If you raise that question in the Pi Forums, what do they say about a fix ?
    (also see the remapping forum link I gave above, which may help )

  • Heater.Heater. Posts: 21,230
    OK, I have no idea.

    But, I'm pretty sure it's possible to use the UART on GPIO and Bluetooth at the same time. It would be crazy otherwise.

    The Pi forum is of course a better place for these questions.


  • jmgjmg Posts: 15,173
    Heater. wrote: »
    But, I'm pretty sure it's possible to use the UART on GPIO and Bluetooth at the same time. It would be crazy otherwise.
    From the above, you can.
    What changed was the UART0/UART1 mapping, which swapped on Pi3.
    Where that proves to be a problem (eg someone needs parity), it looks like they can swap-back - but at the cost of no bluetooth....

  • RsadeikaRsadeika Posts: 3,837
    edited 2016-12-20 11:26
    The Pi forum is of course a better place for these questions.
    I just checked the Parallax Store, and they are selling the Propeller HAT for the Raspberry Pi. If I am not mistaken, that uses the GPIO UART port, so I buy the product from Parallax, and then I have to go to the Raspberry Forum to find out why it is not working?

    Ray
  • jmgjmg Posts: 15,173
    edited 2016-12-19 23:21
    Rsadeika wrote: »
    I just checked the Parallax Store, and they are selling the Parallax HAT for the Raspberry Pi. If I am not mistaken, that uses the GPIO UART port, so I buy the product from Parallax, and then I have to go to the Raspberry Forum to find out why it is not working?
    Err, yes - as you already state, the issues are on the RaspPi side, so why would you not ask the Raspberry Forum ?
    Even more Pi-specific, is your particular issue, which seems related to a change in the config handling.

    If you can explain to them why what they have done is less than ideal, they may (eventually) release a fix.


  • Heater.Heater. Posts: 21,230
    edited 2016-12-20 06:11
    I understand your frustration Ray. Looking into it I find the UART bluetooth situation on the Pi 3 is a mess. For whatever reason.

    Certainly more people are likely to know a solution to this problem on the Pi forum than here.

    We can't hold Parallax responsible for changes in the Pi. What would they do apart from go to the Raspi forum to investigate? Well, we can do that to.

    In fact I just did because I will want UART and bluetooth both working soon.

    The solution seems to be described here: https://www.raspberrypi.org/forums/viewtopic.php?t=138120&p=926637

    I have not fully understood it yet, let alone tried it. Maybe later.
  • Ray,

    I ran into this issue when participating in the Element14 PiIoT challenge. As you found, with the Raspberry Pi 3, the onboard BLE device is tied to a UART. In my instance, after an update on the RasPi 3, the /dev/ttyAMA0 and /dev/ttyS0 (serial0 and serial1) got swapped so the onboard BLE device stopped working as well as the EnOcean device I had connected to the board messing up my OpenHAB config. This also killed the on board WiFi device, so just be aware when updating the RasPi 3.

    It took some effort and searching the web to find a resolution, but basically you can actually swap the assignment of ttyS0 and AMAO between serial0 and serial1.

    You can have a peek here and see my follow on comments where I got the devices working again.
    https://element14.com/community/community/design-challenges/pi-iot/blog/2016/07/09/pi-iot-smarter-spaces-3-remote-horse-feeder-system#comments


  • We can't hold Parallax responsible for changes in the Pi. What would they do apart from go to the Raspi forum to investigate? Well, we can do that to.
    I am not suggesting to hold Parallax responsible. I thought, the way it would work is, Ray rattles his tin cup, hopefully Parallax takes notice. Parallax sales person contacts Pimoroni, which may already have a good solution, if not Pimoroni contacts Raspberry Pi to get the latest official solution, if one exists. Then all the info flows backwards, and voila, an official real workable solution is displayed on this forum.

    At this point I find the existing solution to be non workable, for me. So, I am moving ahead with my idea of using a DNA-RTC and QuickStart board, and the Activity Board will be the master. After playing with some code, for achieving the aforementioned, this is not going to be an easy or pretty solution. Maybe I have to give this some more thought.

    Ray
  • You could try to cluster a set of Propeller and/or BASIC Stamp boards via i2C or SPI an even use a SPI Flash memory device for your memory expansion. Or, use the RasPi as a i2C/SPI master and a set of Parallax boards as slaves to accomplish what you are looking for or even use a MCP23017 (i2C) or MCP23S17 (SPI) I/O expander to fanout the I/O connections using either i2C or SPI.
    For the RasPi check out the PiFace Digital I/O Expander and RTC devices.

    Check out JonnyMac's post Automated Menorah where he used an i2C RTC device for an example of using that sort of device.
  • Well, I sort of solved my problem, I dug out one of my Raspberry Pi 2 units that had an older OS on it. I tested it out and it seems to be working as expected.

    It does have some annoyances, like no built in WiFi, so I have to attach a fairly large USB WiFi. But for test purposes, at least /dev/ttyAMA0 is available and works the way I need it too. Hopefully the Raspberry Pi people will fix the annoyance with the GPIO UART for the RPi 3 unit. I hope it will happen within the next year or so.

    Now I have the Activity Board hooked up to the RPi 2 via /dev/ttyAMA0, and with a small Python serial program, on the RPi, I can now access the RPi to get the real time and date, as a test run. That removes the DNA-RTC board, since I do not need the RTC part anymore. Plus I will be able to use RPi for data storage instead of using the uSD on the Activity Board, more memory available on the Activity Board, for a larger program. I have added a QuickStart Board for more I/O, I will probably need the full 32K of memory on the Activity Board to get everything coordinated.

    Ray
  • Bill HenningBill Henning Posts: 6,445
    edited 2017-01-25 01:00
    Thanks Jim :)

    RoboPi works fine on Raspberry Pi 3 (as well as A/B/A+/B+/2/Zero), as I recall just add "FORCE_TURBO=1" to /boot/config.txt

    The serial port is /dev/ttyS0 or /dev/ttyAMA0 depending on Raspbian version and board.

    http://RoboPi.com
    RS_Jim wrote: »
    Ray,
    Check with Bill Henning and see if he has a solution with his Propeller PI Hat.
    Jim

  • @Bill Henning,
    You are welcome.
    Jim
Sign In or Register to comment.