drivers
drivers copied to clipboard
[WIP] LoRa Driver
Still in progress but simple sending works so putting in a PR now if you've any comments on the API etc?
Hello @torntrousers my initial impression is that this would probably be a good case to implement the https://golang.org/pkg/io/#ReadWriteCloser interface. What do you think?
Sorry for the delay, its schools half term break so I'm away on holiday, i do plan to finish this when I'm back next week.
Thanks for the update!
Hi. I have a question... @torntrousers On what type of LoRa chip are you working exactly? I had been working with SX126x as well as SX1276, they are complitly different in term of API. If it's only for SX127x, maybe better to cahnge package name to semtech/lora-sx127x/ or lora/sx127x/
Thats a fair point @m-chichikalov , happy to rename it, how about just simply sx127x/ ?
Thats a fair point @m-chichikalov , happy to rename it, how about just simply sx127x/ ?
Maybe someone will vote also... IMHO: /lora/ - contain common files for all LoRa drivers( for ex. Interface ) /lora/sx127x/ - specific driver
I think renaming to sx127x
etc. seems like a good idea.
Also probably a good idea to structure the directories as suggested by @m-chichikalov
Thanks for working on this further, @torntrousers just made a few comments, seems like it is close to being able to be merged.
... seems like it is close to being able to be merged.
I would like to finish the remaining unimplemented methods and receive function. Shouldn't be long I hope...
Pinging in hopes of resuscitating this PR... :sun_with_face:
Yes, I'm really sorry, I do want to finish it, its just school holidays so I've kids about a lot and I've also just started a new job so I'm just finding no time to work on this presently. Could close the PR for now or if someone else could do more, or leave it longer and I do really hope to come back to it - I might have some time the last week of this month.
I might be able to look at it, could you resume what it does and what is missing? and a possible setup (never worked with lora before)
@torntrousers how could we help get this wrapped up?
Yes its a shame isn't it. If anyone has a couple of lora boards to test with they could have a go? What happened on my end is I changed jobs so lost the Macbook I was using and only had an old machine running Win7 and the tinygo build doesn't (or didn't then) run on Win7. I did try for a while to get Ubuntu running on that laptop but I couldn't get the screen driver working in Ubuntu so it painted so slow it was pretty unusable. With that I did the last commits here so there is enough that the driver runs but there is some bug so the tx/rx to a non-tinygo lora device doesn't communicate. I'm hoping to get an upgrade from this old win7 laptop imminently so maybe I can get the tinygo build env back up on the new machine and fix this then.
If anyone has a couple of lora boards to test with they could have a go?
So that could be me, but I'm afraid I haven't a clue as to where to get started with ordering the right hardware to start development. Any chance you could share with me what your setup was? I'm pretty serious about helping, debugging, and learning - I'm just very new to learning about microcontrollers and how components actually work.
I bought this one https://www.aliexpress.com/item/32811511435.html?spm=a2g0s.9042311.0.0.27424c4d6NgGko and a node near, but didn't have the time to work on it. It's a sx1278 device, like this driver, so in theory it should work.
@conejoninja i hate to be a complete idiot but "a node near" doesn't seem to be returning anything I can search for :(
I'm afraid I'm not an expert either, but Lora devices connect to a gateway (what I called a node before), the same way a laptop connects to a router. Gateways are usually free to use (under fair use policy). And that's were my knowledge about this topic ends. Hopefully someone else might explain it better.
So that could be me, but I'm afraid I haven't a clue as to where to get started with ordering the right hardware to start development. Any chance you could share with me what your setup was? I'm pretty serious about helping, debugging, and learning - I'm just very new to learning about microcontrollers and how components actually work.
If I had to order now, I wouldn't waste money on SX1276, it's the old version with not serious but still bugs as showed my experience.
Take a look at this http://www.ebyte.com/en/product-view-news.aspx?id=436 I worked with them and got better result. But they have another API, so this driver wouldn't work.
I'm afraid I'm not an expert either, but Lora devices connect to a gateway (what I called a node before), the same way a laptop connects to a router. Gateways are usually free to use (under fair use policy). And that's were my knowledge about this topic ends. Hopefully someone else might explain it better.
If you have two you can connect them together without any Gateway. I think this driver should provide just the Physical
layer from OSI and only other drivers should implement LoRa stack which is other layers.
@flyinprogrammer if you're serious about having a go you'd need to get two lora modules so that you can test sending and receiving to each other. You can use the bare modules like @conejoninja linked to, but it can be a bit of a faf as you need to connect 8 wires to it (something like this), so its easier to start with a development board with both mcu and lora module. The easiest for TinyGo when I was doing this was the Adafruit Feather M0, not so cheap but if you had two of those it would be straight forward to get this code running on it.
Hi .
I have a couple of stm32 bluepill and sx1276 radios:
https://www.ebay.com/itm/5V-SAFE-868MHz-LoRa-SX1276-long-range-RF-wireless-module-for-arduino/322897419029
Do you still need some testing for this driver ?
Olivier
Yes, please!
Hi.
Still working on sx1276 driver tests.
Now, I have two STM32l0x devices with SX1276 running TinyGO.
SX1276 seems properly detected by the driver on SPI Bus,
I hope I can make my first RX/TX very soon !
Olivier
Hi, I could realize my first Lora communication between two STM32 / RFM95 / Tinygo boards ! To do this, I made a few enhancements on HarringayMakerSpace:lora code. (ex: add new APIs, support for RFM95 which requires PA_BOOST ... )
Could you please merge this branch, so I can continue my tests on dev branch, and prepare a new PR with my improvements ?
Thanks
Olivier
Can you work from this branch directly and work from there? I don't want to merge any WIP code in the dev branch.
If you need help to do that in git, feel free to ask.
Hi,
Can you give me instructions for working on someone else PR ? I 've never done that before.
Thanks Olivier
What you'll want to do is create a local branch based on HarringayMakerSpace:lora.
First add the git remote:
git remote add HarringayMakerSpace https://github.com/HarringayMakerSpace/drivers.git
Then fetch all branches from this new remote:
git fetch HarringayMakerSpace
You'll see that it downloads a number of branches, including the lora
branch.
Now create the new local branch:
git branch lora HarringayMakerSpace/lora
And check it out:
git checkout lora
You can now add new commits and push it to your fork of the drivers repo.
Thanks Ayke.
I forked HarringayMakerSpace:lora on ofauchon/tinygo-drivers:lora
Then I rebased the code branch with upstream/dev, and I push a first batch of code:
https://github.com/ofauchon/tinygo-drivers/commit/97f106518c51018933f8b1ef14c1be4be8e0336d
I hope it's the good way to do that.
There is still a lot of testing and code clean up until it's ready for merge.
@torntrousers : Do you have some time to discuss about all these changes, and what's missing ?
Thanks
Olivier
Is there any progress on this?
Hi @JAicewizard .
I had to pause SX127x developpement, because I switched to STM32WLE5 MCUs (which uses SX126x radios)
If you want more informations, please have a look here:
https://github.com/tinygo-org/tinygo/issues/2066#issuecomment-915253095
Do you have some specific need around Lora SX12xx drivers ?
I may give you more details about how to get this working.
Olivier