Build a Lowcost USB Gateway

There are many cheap lora concentrators on the market now, due to Helium denylist. But the Raspberry Pi is still not cheap, and almost all the concentrators are using SPI interface, so here using a STM32 blackpill as the interface convertor, let the concentrator talking with the PC.

All you need is a Linux PC to run package forwarder or basicstation, a stm32 blackpill flashed with following firmware:
FW

Here is the pinning:
PA1: sx1302 power_en
PA2: sx1302 reset
PA3: sx1262 busy
PA4: sx1302 CS
PA5: SCK
PA6: MISO
PA7: MOSI
PB0: sx1262 CS
PA8: sx1262 reset
PB6: SCL
PB7: SDA

My first prototype was based on WM1302 concentrator from Senscap, with many colorful cables. the second prototype is based on sx1302 concentrator from the Pisces P100 outdoor gateway, which has an GPS module on the HAT:



After connect all the cables between blackpill and concentrator, connect the blackpill to an Linux PC, in my case I’m using Ubuntu22, it doesn’t need any additional driver, and the blackpill act as a Visual Com Port, with the name “ttyACM0”

You need to download and compiling the packet_forwarder:
packet_forwarder
after that you can try to start the HW test with the tool provide by Semtech:
Reg test
Com test

if everything is fine, you need to register this gateway in TTN, please refering the related instructions.
then start the packet forworder in the console:


if you want to use basic station, just following the releated instructions, the harsware support this.

Having Fun :slight_smile:

4 Likes

Impressive stuff - being an open source sort of community do you have code that comes with the hex file?

Nice!

Out of interest, why not reuse the controller board that came with the concentrator? The Helium gateway was probably Linux based as well and that combination would use less power then a full PC.

Takes a similar path to the USB version with STM32 as convertor - quote (Seeed Studio docs):

Difference between SPI version and USB version

For WM1302 LoRaWAN Gateway Module SPI version, the Semtech SX1302 and SX126x chip are conntected to Raspberry Pi via the same SPI bus with different chip select(CS) pin.

For WM1302 LoRaWAN Gateway Module USB version, the Semtech SX1302 and SX126x chip are conntected to a STM32L4 MCU, and this factory programmed MCU will work as a USB device, becoming a bridge between Raspberry Pi and SX1302/SX126x.

Hi Jac the top image looks to be from a SenseCAP (Miner) - usually mounted side-car style with a RPI4/3B+ in normal use vs usual HAT direct over placement (rotate through 180 deg so attention needed when connerting to Pi as ‘wrong’ way from normal! So ‘controller board’ in that case - is Pi and guess OP motivated to use something already in hand (Linux PC?) vs go hunt expensive rocking horse droppings right now! :wink: Have 3 off these on bench at the side of me waiting for time to hook up to various Pi’s I have in stock to then deploy on TTN as community node… :slight_smile: :+1:

:thinking: might sacrifice one to try this approach over Easter break :slight_smile:

So someone split the combo to reuse the RPi for something different? If not it would just be a question of running different software on the RPi…

Tell me about it. I have RPi CM4s on order for over 18 months at Farnell and it seems if I’m lucky I might actually get some them this decade. Delivery date keeps pushing back. I know the RPi foundation favors businesses to enable them to ship products, but this way my business is not able to develop the products, let alone start selling them. (I might have some RPi model 1Bs, 2Bs and possibly even 3Bs for sale if anyone is looking for them)

It’s the lottery of finding stock - mostly I hear about it after the fact - that is really annoying as most of the outlets won’t let you order in advance - not even for one or two.

I explicitly asked them to consider allowing small volume commercial customers to place forward orders with selected distributors - so we are putting our money where our mouth is but without any particular indication of when they may arrive - which would hopefully deter the petty scalpers that we see.

But to no avail. :person_shrugging:

Which is why I mentioned to Jeff the idea of going OpenWRT …

Exactly that - the sellers sell both the Conc card and the Pi’s - the latter for >>£/€/€100 and make a killing! Not suprising give many cards used fakeGPS and ended up on Helium’s deny list and even those that didnt now face:

So not even covering electricity bills!

Many of us have said for years they look forward to buying cheal GW’s/parts once bubble burst! :slight_smile: “It’s an ill wind that…” or perhaps “Every cloud has a…”

Indeed - an option to evaluate - but do I not recall seeing a year or two back that it was only supported as a potential LoRaWAN ‘router’ (Gateway) platform on a limited set of Mediatek MCU’s or was it that those MCU’s only saw a limited OWRT release set…? :thinking: as you know not too up on s/w side of life :wink:

yes, after I tidy up the code I will put it on Github :slight_smile:

RAK use Mediatek, Dragino use ASR, there are many many vendors supported by OpenWRT which flies under the wire because it doesn’t do graphics, so the polar opposite of the Pi’s 2 x 4K HDMI outputs.

OpenWRT is Linux at it’s core. It has it’s focus on routing but the Dragino code base clearly shows how you take the source code for the packet forwarder and compile it and run it, just like you would do with a Pi. But without a keyboard, mouse or 2 x 4K monitors.

The ‘plus’ for me for a Pi is being able to run a dashboard with the mandatory 2 x 4K monitors as a Pi4 2GB has bags of memory & horsepower to be a gateway & a dashboard at the same time. And if you strap an SSD on to your Pi it could be an endpoint for the integration - most likely yucky MQTT depending on your ports. And if you miss a MQTT message you can always backfill with the Storage Integration.

Which is exactly what the original SMTC IoT Dev Kit was - a Pi (2b?+?) inverted onto a pcb with the SX1301 Conc card ref design onboard, shipped with a LoRaMOTE, ant, PSU and ran OS/PacketForwarder/BasicLNS Reference Code, Simple network SSH to GUI front end showing decoded data and graphs for the 'Motes sensors (battery, Temp, barometric pressure, etc.), ability to add sensors/motes & apps + Web GUI had a link that pulled decoded GPS data presented on Google Maps - perfect for site testing and coverage checks :slight_smile: Pity it went unsupported/obscolete - then someone in the dev group(?) forgot to renew credit card details or some such and developer access to G-Maps dies :frowning: ah well! Fond memories…and at least 5 UK Commuities up as a result along with several private networks and local councils of the back of some tests… :slight_smile:

You were lucky, all we had was a certified flight logger that had to be calibrated every year, and we had to find our own 12VDC for it and it cost half-a-months wages …

the point is the HNT players sold the concentractor seperate with the Pi, a RPi3/4 can be sold arround 90-150 euro, after that the concerntrator only can be sold around 30-50Euro, which is much less than its actual BOM cost. I remember in last year when I want to buy a gateway, the cheapest sx1302 concentrator needs 130Euro and out of stock, then I bought a TTIG arround 108Euro, which based on sx1308+ESP8266, it has essential function but the signal is not as powerfull as sx1302+external antenna, it receive much less telemetries compare with sx1302 within the same time windows. However, it’s still a great device to experience TTN.

In the example 2 concentrators are used, one is from Senscap indoor miner and one is from Pisce P100 outdoor gateway, which was sold more than 1k euro when HNT was hot :rofl:

The Pisce concentrator HAT has a quectel L76K GPS module, which also support UBX meassage even it’s never mentioned in their datasheet. it almost full compatible with the expensive Ublox-7 GPS module which used by Semtech’s offcial design. I want to compare the performance of this 2 concentrators, I tested them 3 times with the same antennas by place them at the same position,1 time WM1302 received more telemerties, 2 times Pisces received more, so it’s hard to say, which is better :joy:

With USB interface it can reduce the gateway cost furthermore, theoretically you can use a cheap thin client which can run linux as the host, the thin client can be get with around 20 euro on Ebay. I’m also considering to use ESP32 as the host, to reduce power consumption, also a MT7628 with Openwrt may also be an option, but have no time to play, the HWs are ready and already slept there for half year :smiling_face_with_tear:

2 Likes