BRI/FXS self contained remote OCTOI node

So I wanted to open a topic here to discuss what I have in mind and what I’d like to work on related to https://osmocom.org/issues/5417 .

In short, I’d want a self contained device offering both BRI and FXS port that uplinks to the OCTOI network. You put power and a network connected and it’s up and running.

As such from a hardware point of view, I’d orient myself toward a RPi hat form factor. Why a RPi ? Well they’re common basically and easy to obtain. Yes there are cheaper alternative, but at least from my PoV it doesn’t matter much. The way I see it the time cost investment I’ll make to get it working dwarfs the host device cost.

I’m also going for a full linux host type of thing rather than say some powerful micro controller running NuttX or FreeRTOS or Zephyr or such. Although it would be a more elegant solution, I think it’s also quite a bit more work so I’m going for what I think has the best change to actually achieve something. That issue on the tracker has been opened for 4+ years so I think it’s fair to say we’re all short on time.

For the interfacing to the RPi, the first plan is to try to go with everything going over the SPI port of the RPi. Possible alternative plan are to use SPI for control and somehow coerce the I2S interface to work for the PCM data or to have some other microcontroller or FPGA on-board and use USB but then it’s not really a “hat” anymore and you have one more piece of code to develop …

As mentioned above I’d like to have BRI ports, probably 2 of them and then two slots to put those S110M module for FXS port. Why mix BRI and FXS ? To put it simply the S110M module need the voice data to go through a PCM interface and the XHFC-2SU can be used as SPI → PCM bridge so it’s convenient to do both at once … As to why bother with FXS at all, well I’m more into analog modems than ISDN :smiley:

It’s possible not all ports will be usable at once ( bandwidth restriction ) but that’s fine for me.

On the software side, all the ports would show up as DAHDI device and
there probably would be a yate or asterisk or something running. This would handle dealing with FXS stuff and the uplink to OCTOI.

How is the uplink done ? Well I’ll open another topic to discuss this since it’s a bit orthogonal to the “hardware” side of things.

6 Likes

I would be very interested in such an adapter. Since I am also interested in the transmission of digital information over analog telephone lines, I would find FXS ports extremely exciting as well.

How about the devices connected to FXS ports? Would Yate then function as an a/b adapter in this case? And would the data stream from the BRI ports also go through Yate, or would it be forwarded directly?

I also assume that this adapter would have a GPS receiver / PPS input?

Yes of course I’d include some clocking circuit to lock things.

1 Like

Why would you use the S110M modules? Is FXS electronics so complicated?

I would also be interested in this project.

tty, Stefan.

It’s just easier … FXS is full of analog stuff and relies on chip you can’t easily source anymore. Also I’d best some people won’t care about FXS and so will never use the slot.

It also means if you prefer you can put a FXO module there instead if you have a need for that.

1 Like

Hi @tnt ,

I am still in the process getting some NT-capable BRI hardware.
Some HFC-S (USB) stuff just arrived / is on the way, thinking of a multi-BRI PCI card as well. So, I’m absolutely interested in a n x BRI connector to OCTOI.

Just two notes from my side: for a quite simple task like moving data between an HFC with SPI interface and USB on the other end Nuttx, RTOS, Zephyr et al are completely unnecessary and mostly point-/useless.
If there is no academic paperwork to be done how to (forcefully) put a realtime OS on a MCU into some usecase, ignore it. Most things run better without and it only consumes development ressources and creates unnecessary PITA.

For the data rates of 2-4 BRI ports don’t use an FPGA. It’s just another PITA factor. Sounds cool, easily turns into a mess if you want to do more, update things, be flexible. Or use an expensive, kinda oversized chip and expect everyone to deal with hardware description languages. (I just got annoyed again by Vivado/Vitis :see_no_evil::joy: … PCIe interfaces)

I totally understand your motivation to create another Pi hat, but keep in mind Linux will not always let you deal with SPI in a somewhat “bit-synchronous” way. You’ll see the performance degrading with increased jitter if RPi OS/Debian looks for updates, someone logs in over SSH, etc.

Since cheap, mass-available ARM/RISC-V chips with multiple DMA engines, tightly coupled (zero waitstate) multi-bank RAM, native SPI, I2S, USB hardware and programmable IO units exist there are much easier options. More energy efficient, less jitter, possibly off-loading capabilities, driving status displays/LEDs, etc.
(iMXRT1062 and similar with NXP FlexIO / RP2350 with PIO)

So I would at least like to ask for a pin-header / connector to use auch a MCU instead. And be able to connect to smaller/other Linux devices than just Raspberry Pi.

Thanks a lot for your efforts and all the best,
Christian

In fairness: Lattice chips (iCE40, ECP5, etc.) with yosys toolchain support are super nice to work with.
The open-source tooling for it is very nice, can be run in CI build pipelines and isn’t anywhere as annoying as Vivado, etc.

Skill issue, Linux is quite good at keeping realtime-ish operation (on the order of μs) if you tell it to.
And also, the timing/jitter is being internally generated in the interface IC from an external clock.
As long as the FIFO of the interface IC doesn’t run empty, nothing happens (and if your code didn’t run for milliseconds at a time, you really messed it up)

Ah, thanks! Good to know. Meanwhile, there are also USB2 ip cores.

Well, that’s not just my idea or “skill issues”. That’s an industry-wide concept.
That’s why chips like https://www.nxp.com/products/processors-and-microcontrollers/arm-processors/i-mx-applications-processors/i-mx-8-applications-processors:IMX8-SERIES exist. As you can see, they already contain one or more Cortex M4F/M7/M33 cores for (hard) realtime requirements. In the aerospace sector, we began conducting our experiments using parts from the automotive industry.

Since we have not only power input limitations, but also power output limitations (heat), using a multi-GHz 64-bit core for an I/O task is anything but efficient. :wink: That’s just my perspective, and I’m simply wondering if it would be possible to operate the HAT in a non-HAT mode, perhaps not with a Raspberry Pi.

I didn’t want to discuss people’s ability to adapt Linux for real-time applications.
(and you don’t know my code and where I came from either, like writing hardware abstracting supervisors for Linux kernels in baremetal Go…)

Best,
Christian

Indeed, but we’re not talking about aerospace or automotive applications here, it’s a hobby project with limited developer time and definitely no human life attached anywhere in the chain. It really doesn’t matter.
Wasting 3-4W of power to run a Linux SBC just to save a couple of weeks of our developer time is also a very reasonable tradeoff.

And also: Sure, you can just connect a Raspberry Pi HAT with some jumper wires to any embedded board of your choosing. Why shouldn’t you?
Boards, HDL, Schematics, etc. will all be open source from the people in this community, hack away to your hearts content :slight_smile:

I think that whoever ultimately invests their time in writing code and designing hardware should be the one to decide how it is implemented. And if that results in a Raspberry Pi + HAT solution, that would certainly be a solid foundation to later tackle a port to an RP2350 + W5500 (my dream scenario). Assuming, of course, that the necessary manpower can be found.

For now, I’m just very happy that there’s a new attempt being made on this topic :slight_smile:

1 Like

That is exactly right (and it’s also how this is going to happen eventually) :slight_smile:

Well, it was just a question and putting in some ideas.
But I will stop that, of course.

It wasn’t meant to come across as rude either. :slight_smile: The way I know the community here, questions and suggestions are always welcome :smiley:

1 Like

So a few points :

  • The real-time OS comments I made wasn’t for the case where the uC only does spi/pcm <> USB case. I was talking about the case some powerful uC would have an ethernet interface directly and so we’d run a full tcp/ip stack and telephone stack along with custom BRI/FXS driver all in a single uC. And at that point I think we’re getting in the realm where having an OS to manage “tasks” and allow for easier porting of existing code to it can be useful. In anycase, this scenario is very improbable to happen …

  • uC vs FPGA : I understand that many people are way more familiar with uC than FPGA. But that’s not me. For me it’s the opposite, I’m way more familiar with FPGAs and I have a way easier time writing some custom peripheral in verilog than trying to coerce some micro in doing what I want … That’s why the FPGA is an option here … I’m hoping to need neither, but if I end up having to use one, it might depend on my mood that day or which dev board I find first or if I feel like trying to get a better understanding of the pi pico that day or not. If I use a FPGA it would definitely be one with an OSS toolchain, I don’t want to deal with vendor tools for hobby project, I have enough of that for my “day” job.

  • SPI “real-time-ness” of RPi. First, I’m not imagining a “random OS” running. I see the running install more like a stripped down version with just what’s needed running. People would basically download a pre-built OS image and use that and never have to mess with the OS. That makes things more deterministic.

As manawyrm said the critical timings are handled by the chip itself, and given the size of the FIFO, the actual constraints are not that tight.

But in any case I will be testing stuff using the current breakout board and “flying wires” before I design any new hardware. Only when I get stuff running in a stable way will I commit to a specific design. And on the driver side the way to read/write control register and to read/write the FIFO will end up pretty abstracted so it’s quite easy to first write the driver for the simplest case (everything through SPI using standard kernel interfaces) and then if that turns out to not work or not be reliable enough, to move to a different transport mechanism without having to throw away a lot of the already written code.

2 Likes

Would it be feasible to develop a custom Linux distribution for the Raspberry with precompiled DAHDI and Yate specifically for BRI-to-OCTOI, but with additional support for icE1usb? This would help bring everything to life without the hassle of manually compiling and configuring Yate and the other stuff.

I would like to help with this project, but I currently lack sufficient knowledge of Yate’s configuration.

Yes, absolutely. Not even very hard to do, just a bit of effort.

So I did a bit of experimentation this weekend and managed to get @Manawyrm 's results reproduced. Basically getting the mISDN driver working on the breakout.

I got LCR running on that too although I couldn’t do much beside test call. I couldn’t manage to get a “loopbakc” call (where a single TA calls itself on another extension from one B channel to the other).

I’ll try to push an updated patch since there were a few gotcha. Although the biggest issue I had was some broken solder joints on the QFP which meant I didn’t have any sync initially

I also started on a dahdi driver although for now it’s mostly an empty skeleton, but I wanted to check my setup (hw and TA ) were working before trying to write a new driver.

4 Likes

\o/ Awesome :slight_smile: