lora-gateway / esxp1302

An 8-channel ESP32 LoRa Gateway based on SX1302
Other
50 stars 26 forks source link

Add miniPCIe interface to the board design? #4

Open danielkucera opened 11 months ago

danielkucera commented 11 months ago

Hello,

I am successfully using this firmware with LR1302 from Elecrow and my miniPCIe breakout board. This is my current setup.

IMG20231217152824

Would you consider adding miniPCIe connector to your current HW design according to this spec? I tested the same setup also for RAK2287 and it works .

I was considering doing it myself but I don't have the design software to edit your project and I am lazy to design it from scratch.

lora-gateway commented 11 months ago

@danielkucera: Thanks for this proposal. Since the market already has some miniPCIe based modules available, it would be easier for people to have the hardware ready to play with.

First, I'd like to check if all of them (or most of them) follow the same spec; then I plan to create an interface board to bridge the miniPCIe connector to the motherboard. I need help from a friend to do this, so it would take some time.

BTW: What's your design software? Is it KiCAD? Maybe in the future, someone can help to convert the hardware design to such tool so more people can modify directly...

danielkucera commented 11 months ago

Thanks for the reply. Yes, I prefer KiCad. I even managed to import the board design and I am trying to add the interface. This is my current WiP: image

Maybe I can manage on my own :)

danielkucera commented 11 months ago

First, I'd like to check if all of them (or most of them) follow the same spec;

I believe they all come from this reference design: https://www.semtech.com/products/wireless-rf/lora-core/sx1302cssxxxgw1#documentation

dennis4lora commented 11 months ago

Great, the design can support both kinds of interfaces, I think it's better than my idea to add a bridge board.

Still, I think there are compatibility issues needs to be noted.

First, I compared the miniPCIe Pins of RAK2287 and LR1302. Their SPI pins and a few other critical pins are the same; however, the pins for SX126x (used for LBT) doesn't match.

I believe they all come from this reference design: https://www.semtech.com/products/wireless-rf/lora-core/sx1302cssxxxgw1#documentation

I then checked the Semtech reference design, Oops! totally different from RAK2287 and LR1302, as below:

image

Which makes me doubt if Semtech has updated the design, while RAK2287 follows an earlier one?

So I checked a few such products selling in Chinese Market:

Conclusion: Compatibility issue does exist. If we don't need LBT (in fact ESXP1302 doesn't support it so far), then following the RAK2287 spec should support the major miniPCIe products available from market.

danielkucera commented 11 months ago

Oops! totally different from RAK2287 and LR1302

This completely slipped my attention, I was in the impression it is the same but you are right.

following the RAK2287 spec should support the major miniPCIe products available from market.

I totally agree.

danielkucera commented 9 months ago

So I had it manufactured. IMG20240124115444

The biggest surprise were those 0402 resistor pads - that is really something hard to assemble at home so I just bridged them with solder.

But anyway it works as expected 👌

dennis4lora commented 9 months ago

Great, congratulations! :+1:

rwijbenga commented 5 months ago

@danielkucera Could you share the schematic for the miniPCIe wirring to the ESP32 ?

Or the board files? :)

danielkucera commented 5 months ago

Hi @rwijbenga , I don't have Altium so I just imported the board to KiCAD and botched in minipcie and wired the connections. You can find it here: https://github.com/danielkucera/esxp1302/tree/minipcie/hardware_design/motherboard

M10CUBE commented 2 months ago

Hi @danielkucera I came to your design working a LoraWAN solution from seeedstudio https://www.seeedstudio.com/WM1302-LoRaWAN-Gateway-Module-Without-SX126-SPI-EU868-p-5847.html I think similar to ELECROW LR1302

Our KICAD OSHW project https://wizcube.eu project has similar PCB dimensions (90X90mm and holes 4mm from edges) a I am thinking to make a similar design using the on board Raspberry Pico . Is that possible? I mean is any LoRaWAN software available for the RP2040 CPU?

Since our wizcube boards have already Raspberry Pi 40 pin connector I imagine a combination of: 1 - mini PCI 1302 module from seed studio or elsewhere https://www.seeedstudio.com/WM1302-LoRaWAN-Gateway-Module-Without-SX126-SPI-EU868-p-5847.html 2 - A mini PCI HAT from seeedstudio or elsewhere. (may be found open source and manufacture our self from Gerber file) https://www.seeedstudio.com/WM1302-Pi-Hat-p-4897.html

Plugging these 2 on any wizcube.eu module we have LoRaWAN out of the box. So the question now is if LoRaWAN exists for Raspberry RP2040 or 2350 core? If not plan B is to use an ESP32-C6 CPU on a raspberry Pico footprint made by Waveshare directly plugged in on a wizcube PCB. It comes cheaper that the ESP32 DEV board. Then voila! . LoRaWAN without designing any new PCB.

I would like to have your idea since we are redesigning out wizcube.eu boards correcting some issues. If the above idea looks good we can include your comments to new design and of course everybody can benefit from our OSHW concept

I could like to have your opinion and help me on taking the right decision. Thanks Vasilis

danielkucera commented 2 months ago

Hi @M10CUBE , LoRaWAN most likely exists for RP2040 but not with SX13xx drivers, just as client.

dennis4lora commented 2 months ago

I agree with @danielkucera that there is no suitable sx130x project for RP2040 yet. Search on Internet, I find some results using RP2040 with LoRa as end device, and I'm afraid they are only based on the drivers for Rx and Tx, not even compatible with LoRaWAN protocol.

Currently, there are two LoRaWAN implementations provided by Semtech for end device:

but none works on Raspberry Pico.

OK, back to the gateway topic. 😄

This ESXP1302 project is tightly bound with ESP32 since it based on esp-idf using lots of services from that framework, and it also uses the Wi-Fi from ESP32 as its backhaul. Which means you can't replace ESP32 with another MCU and expect the firmware still works.

But if you only use ESP32-C6 to replace the original ESP32 MCU, I expect there would just need very trivial changes to make it working. You may find #23 is interesting.

M10CUBE commented 2 months ago

Thanks @danielkucera . I think soon we will see it on RP2350 MPU Anyway the current status leaves me to use a ESP32-C6 CPU raspberry Pico footprint What is needed to make the test:

I have provision on board to get SPI signals from 40pin Raspberry Pi connector on the edge. With this configuration I think I can load your firmware and get it to work.

But of course the final plan is to make what you did but using the wizcube PCB mechanics. That is to stick on using Raspberry Pico footprint (Many incarnations. ESP32, RP2040, RP2350,) plus the WM1302 footprint on board. Your way eliminates the cost for the Hat hardware. In fact our design can be called a LoraWAN Hat with the application possessor on board. It will be the cheapest way to make it. The code name for that will be M10LR01-01

I also have to mention that we are preparing the ARGO module wizcube.eu/argo.html It will take some time to finish but it can be drop in to M10LR01-01 PCB . Specs: LoRaWAN Gateway to 4G, LTE-M/NB-IoT, WiFi6, BLE, DECT NR+ modem, GNSS, Thread and Matter The SDK for these chips is based on Zephyr RTOS. I see now that only SX1276 supported but I am sure 1302 will came soon. https://github.com/craigpeacock/Zephyr_LoRaWAN

It looks that you have KiCAD knowledge. If you are whiling to contribute on this OSHW wizcube team project you are welcomed. Then you can get the design and do whatever you like. Having said that sorry for hijacking the space but that was done in a hope to help others as well Regards

M10CUBE commented 2 months ago

Thanks ,

Currently, there are two LoRaWAN implementations provided by Semtech for end device:

* [LoRaMAC-Node](https://github.com/Lora-net/loramac-node) is deprecated

* [LBM](https://github.com/Lora-net/SWL2001) has been ported to [NRF52840](https://github.com/Lora-net/SWL2001/tree/master/lbm_applications/2_porting_nrf_52840)

but none works on Raspberry Pico.

OK time to forget RP2040 at the moment as being LoRaWAN device. Lets move on OK, back to the gateway topic. 😄 This ESXP1302 project is tightly bound with ESP32 since it based on esp-idf using lots of services from that framework, and it also uses the Wi-Fi from ESP32 as its backhaul. Which means you can't replace ESP32 with another MCU and expect the firmware still works. You may find #23 is interesting.

The #23 is fantastic. I will get one. I have XIAO ESP32-C6 in the LAB. Edit: The module on board is not XIAO but other footprint. Change of plans or order some.

But if you only use ESP32-C6 to replace the original ESP32 MCU, I expect there would just need very trivial changes to make it working.

I absolutely agree and the solution looks one way road:

To try the above since it does not cost me any KiCAD time. Maybe some simple wiring under the board I also asked here and apply it to project ARGO (nRF9151) . https://github.com/craigpeacock/Zephyr_LoRaWAN/issues/2#issue-2477758665

I think Zephyr is the keyword. If the chip supports Zephyr you have tons of drivers out of the box. That is the case with Nordic chips. As you Know Arduino is moving to Zephyr now.

HeadBoffin commented 2 months ago

but none works on Raspberry Pico.

How about the LoRaMAC-node port by Sandeep Mistry here: https://github.com/ArmDeveloperEcosystem/lorawan-library-for-pico

Or RadioLib here: https://github.com/jgromes/RadioLib

If the chip supports Zephyr you have tons of drivers out of the box.

About a tenth of the ones that Arduino has

As you Know Arduino is moving to Zephyr now.

Only for ARM based boards.

dennis4lora commented 2 months ago

@HeadBoffin:

You are right, thanks for pointing out those 2 projects, which are both work on Raspberry Pico as LoRaWAN client.

As for Arduino, I guess it doesn't matter whether it uses Zephyr not. And for ESXP1302, it's based on esp-idf which bases on FreeRTOS, so it's hard to switch to Arduino or Zephyr...

PureTek-Innovations commented 2 months ago

Lilygo now sells an ESP32 with an optional PCIe adapter https://www.lilygo.cc/products/t-eth-elite-1?variant=44498204983477

They also have a very similar codebase with working ethernet https://github.com/Xinyuan-LilyGO/LilyGO-ETH-Gateway

I've ordered a set to try.

danielkucera commented 2 months ago

They even have the same typos in the code:

static int dns_loopup
M10CUBE commented 2 months ago

@PureTek-Innovations Yes I was aware of that but I "lost it in the translation". It is the most interesting combination. I am wandering. Is it possible to combine it with their 4G Shield? . Total we need: 1 - T-ETH ELite 23.99$ 2 - Gateway shield 10.99$ 3 - T-Sx1302 LoRa concentrator module 51.66$

  1. LTE Shield 12.99$
  2. A PCI LTE card around 50$

That is 149.63$. Not bad for a hackable LoRaWAN concentrator/LTE, WiFi, Ethernet Gateway ready to read many more sensors attached. Note to the above: Seeedstudio is selling the Wio WM1302 LoRaWAN card half the price 25$. I am wandering if it fits. We are going to order this for our Raspberry LoRaWAN project. If it fits total cost will be around 125$. That is really nice. Well I am still not satisfied. I have a project in mind to bring the cost for all that well under 100$ with more goodies. Patience is needed

I am waiting to see your results.