News for hackers. Stuff that matters.
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by LispSporks22 on Tuesday October 17, 2023 @05:26PM (#37921807)
I like this idea, but what do you do for GPIO (and SPI, I2C etc.)?
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by synack on Tuesday October 17, 2023 @05:34PM (#37921911)
Arduino or similar over USB.
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by petsfed on Tuesday October 17, 2023 @05:49PM (#37922077)
This is, in almost every respect, the better way.

Any non-real-time operating system will eventually get a little bit buggy around timing intensive operations like I2C or (especially) SPI. Better to have your GPIO operations performed by a dedicated micro that only handles your serial traffic and whatever pin-twiddling operations you need to do. Ideally, your serial traffic is in a binary protocol like MODBUS-RTU, so your traffic parser is as fast as possible.

Bitbanging I2C or SPI is tedious but generally pretty achievable in a bare-metal application. But unless you're hacking your kernel to force that kind of timing fidelity, bit banging on an RPi running Debian is just impossible.

Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by megous on Wednesday October 18, 2023 @12:08PM (#37930731)
Sounds like this would be very annoying compared to a SBC. You have typically several SPI, UART, I2C, gpio interfaces on the pin header on usual ARM SBCs. Ready to use from Linux via standard API, using DMA, etc.
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by petsfed on Wednesday October 18, 2023 @02:04PM (#37932381)
I once had a very simple I2C operation performed on an Orange Pi running project nerves. I had to add a try-again loop to the I2C operation, because the underlying OS kept disrupting the I2C timing. I2C is generally run between 100-400 KHz, so you'd think it wouldn't be an issue, but it definitely was. You can get around this by patching the kernel to carve out timing protection for those operations, but speaking as a firmware programmer, if I'm patching the kernel to avoid writing a simple arduino sketch, I've made some pretty deep mistakes.
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by megous on Thursday October 19, 2023 @07:15AM (#37941233)
100 khz is still very fast, with sub-millisecond I2C tranfers possible.

You'll have the same issue on any SBC running Linux. You'd need to carefully use realtime process scheduling, if you want more predictable timing on a general purpose OS for such stringent timing requirements.

Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by baz00 on Tuesday October 17, 2023 @06:23PM (#37922411)
This is the correct solution.

What I see a lot of is people trying to cram all sorts of shit into a Pi and expecting everything to work properly. I actually wrote a fairly small event-driven kernel for AVR parts a few years ago called XOC "exec-or-communicate" which could do small real-time tasks easily (combinational logic, state machines, interrupt handling) and delegated complicated ones to a host machine over virtual serial port. It was used for a metering system I developed. The AVR side could withstand a complete host failure and reboot.

Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by kcb on Tuesday October 17, 2023 @06:46PM (#37922598)
Or esp32 over wifi.
Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by westurner on Tuesday October 17, 2023 @07:23PM (#37922884)
USB to 2x20 pin GPIO (like Raspberry Pi have) should be easy.

Found this:

"Ryanteck RTk.GPIO (PC GPIO Interface)" https://uk.pi-supply.com/products/ryanteck-rtk-gpio-pc-gpio-...

gpiozero > Remote GPIO: https://gpiozero.readthedocs.io/en/stable/remote_gpio.html :

> GPIO Zero supports a number of different pin implementations (low-level pin libraries which deal with the GPIO pins directly). By default, the RPi.GPIO library is used (assuming it is installed on your system), but you can optionally specify one to use. For more information, see the API - Pins documentation page.

> One of the pin libraries supported, pigpio, provides the ability to control GPIO pins remotely over the network, which means you can use GPIO Zero to control devices connected to a Raspberry Pi on the network. You can do this from another Raspberry Pi, or even from a PC.

Presumably, e.g. TLS to secure that control channel is your responsibility.

Parallel ports > Pinouts: https://en.wikipedia.org/wiki/Parallel_port#Pinouts

"The parallel port" (2023) https://news.ycombinator.com/item?id=34585216

Serial port: https://en.wikipedia.org/wiki/Serial_port

UART: Universal asynchronous receiver-transmitter:

Serial TTL: https://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_... :

> TTL serial refers to single-ended serial communication using raw transistor voltage levels: "low" for 0 and "high" for 1. [31] UART over TTL serial is a common debug interface for embedded devices.

"Possible to use a 9 Pin Serial port as "GPIO" using ioctl()?" https://stackoverflow.com/questions/27789099/possible-to-use...

D-subminiature > Typical applications > Communications ports: https://en.wikipedia.org/wiki/D-subminiature#Communications_...

Crosstalk: https://en.wikipedia.org/wiki/Crosstalk

"Can you hotwire this computer to transmit a tone through the radio?" https://www.getyarn.io/yarn-clip/aac07d77-c6d6-4da7-bdd3-b93... https://en.wikipedia.org/wiki/Air-gap_malware

Re:Raspberry Pi 5 vs. Orange Pi 5 Plus vs. Rock 5 Model B by mianos on Tuesday October 17, 2023 @09:19PM (#37923793)
ESP32s. So easy. As well supported as any RaspberryPi.

Proper real time on the metal. Interrupts. Native i2c, i2s, spi, serial with a cross-plane so you can re-route most pins around, depending on the board and a few minor caveats.