#help-with-radio
1 messages · Page 5 of 1
Thanks, unfortunately our transmitter didn't work at that sort of range so either the gain of the dipole wasn't high enough or the transmitter was just weak. But at least we got some data.
I have the Adafruit RFM69HCW Transceiver module (https://www.adafruit.com/product/3071)
With uFL and a small antenna. In ideal conditions it only goes for like 70 meters, even with extremely brutal settings.
In a worst case it goes like 40 meters.
I want a module to use in a shipyard. I need it to work for 200 meters reliably. I will only be transferring about 40 bytes at a time, so I can go brutal with the settings.
Is the Adafruit RFM95W LoRa Radio Transceiver module (https://www.adafruit.com/product/3072) going to be capable for it?
I want it to take small obstructions if possible.
The thing is I want to use it a shipyard which has a lot of iron around, and there are stuff everywhere. I can get the receiver high up but the transmitter is going to be moving.
"You see, wire telegraph is a kind of a very, very long cat. You pull his tail in New York and his head is meowing in Los Angeles. Do you understand this? And radio operates ...
Before anyone asks, I had used a 433mhz antenna, on the 433mhz module.
I think you are just going to have to try it. The LoRa module will have longer range, but you really need to try it in your conditions to make sure. There are a number of "lora range" threads in the forums you can read; a few people have done rather systematic testing.
you will want to experiment with antennas too; don't use some smaller compact antenna which might be less efficient
Is a spring antenna gonna be better than one of the compact generic black antenna's?
start with a 1/4-wave wire instead of something with a coil in it
Alright. Thanks!
a full-sized black one would be ok, but better if it is full-sized, which for 433 MHz is kinda tall (17cm or so)
really, though, it is best done experimentally. You could try a 1/4-wave, and a black one, at some distance, and see what the RSSI differences are. It will also depend on orientation. the typical pattern around a stick or straight wire antenna is a torus
strongest signal is perpendicular
Using rfm95 with the antennas lady ada recommended from digikey. To my knowledge the only feedback on signal strength is the RSSI and SNR. I don’t have a scope or any fancy equipment. I noticed the rssi db change when i switched antennas to sma that actually physically connect now. 😅 Can you recommend a resource I could read up on what is a good db, bad db, for basics. I don’t really know how to interpret the rssi results.
Without antennas sitting next to each other i was getting -100 or so db. With antennas connected sitting right next to each other I’m now getting about -51 db. Is that sufficient to go about 1000 meters at least?
1km is line of sight, and maybe with gain antennas. I'd suggest that you set one going and go out in the street or a field and see how it works.
Good point. Just need to test it. I live in a city kind of and the final install will be out in the country in a different state.
The bad part is my receiver is inside a giant clear mailbox which requires 12v for the amplifier. Its not exactly portable. 😞 I think i do have a 3rd rfm i can setup and go for a drive with. 👍
Even with my only-good-for-40m rfm69 setup when side by side they have an rssi of -26.
-50 is horrible.. I bet it will go like 20 meters.
Rssi, bigger is better:
-20 you are in front of it.
-40 average reception.
-80 hello do you hear me? Packet loss go brr.
-85 💀
Try it in your house without line of sight first.
A thing I found did interference for me was my big tv.
Putting it behind it increased rssi by 15
For me increasing tx_power to max and preamble to 10 really helped.
Also, smaller bitrate seemed to also help.
Just soldered up a 3rd rfm with reverse tft s2. Nice compact package with a battery for field testing.
Possibly my bad soldering for why the antenna performance is poor. The edge launch sma adapters are tricky to solder.
Anyone know what ic is use here...
https://www.getfpv.com/flywoo-bt-nano-v2-bluetooth-module.html
Obviously it's new
Silly me,
Step 6: Build a Duga radar that is so powerful that it disrupts and jam ham radio in a 50 light years radius by replacing it with loud pings and buzzs
Any advice for grounding an antenna used with a Raspberry Pi 3 A+ and an RTL-SDR dongle?
Trying to capture NOAA weather APT audio streams and I get some pretty noisy results.
And you can feel the static on the thing when it's receiving.
You can either use a grounded power supply, or simply ground the antenna shield.
Does anyone have experience using the RFM69 Featherwing with the Feather M4 Express? I’m having a strange issue. I can get it to initialize and go through setup. It even connects to the transmitter. However, when I remove the transmitters power, it still says it’s connected. I’m using extremely similar code to another project that uses two M0 feathers with the built in RFM69 and those work. If you need more details I can share. Code is basic right now
I've used them together many times, but I have never tried disconnecting power to the feather wing. -- how are you doing that?
Sorry, I think I explained poorly. The feather wing is attached to the Feather M4 on one of the triplers along with the OLED screen. This as a unit acts as the receiver and is provided power consistently (I do not turn it off during the testing). The transmitter is a Feather M0 that has the built RFM69. During the test, the OLED displays a message whether it’s searching for a connection, or if it’s connected. That’s the setup. The test is this: allow the M4 receiving unit to boot up and look for signal, then plug in the M0 using USB. This causes the M4 to display the connected message. I then unplug the M0, the code should cause the M4 to now say “Searching” again now that !rf69.available() should be true. However it continues to say “Connected.”
@twin pasture might help to post the receiver code. there is no "connection" per se, the receiver listens and if there is a packet, it gets the bytes, and then presumably immediately listens again
it may be that the "connection" text isn't changed in the code when the receiver times out due to no new packet
is there a special format I should follow or does a screenshot suffice?
post a file using the "+" sign to the left, files are much better than screenshots. OR, check the #welcome for how to paste in smaller chunks of code with formatting
(be sure there's no private info in the code)
Is this Arduino or CircuitPython?
I'm writing this Platform IO. The loop is pretty short and simple so I'll try to format it as a chunk
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
if(!rf69.available()){
display.clearDisplay();
display.display();
delay(1000);
display.setCursor(0, 12);
display.print("Searching...");
display.display();
delay(1000);
}
if (rf69.available()){
display.clearDisplay();
display.display();
delay(1000);
display.setCursor(0, 12);
display.print("Connected!");
display.display();
delay(1000);
}
}
To me this should be checking if a signal is available, and if the signal from the transmitter drops, it should go back to searching, and displaying that
I'm not sure where I'm going wrong
is it possible it's picking up packets from some other nearby transmitter?
So when plug in the M4, it will boot up and display "Searching" indefinitely from what I've seen. It only displays "Connected" when I plug in my M0.
So unless some weak signal piggybacks of the M0 (Idk if that's even possible), but I don't personally have any other sources running, and I don't expect my neighbors are running anything that should interfere either
oh, I think you need to read the packet, to clear out the rf69.available(), not sure why different between M0 and M4
hmm okay, maybe it will resolve itself if I keep writing and actually receive the data then
I think so, the bytes stay in the buffer until read / received
(if you have encryption in the set up, you shouldn't get stray packets from others)
Gotcha, that's a good explanation. I'll keep pushing along then, I've just been trying to add code incrementally. Thanks for the good advice!
Yeah, I have the encryption set up
@umbral oxide I think you were right, when I added the next stage of code, it fixed the issue
Thank you again, that was really helpful!
Afternoon everyone,
It's been quite a while since I last dropped by - glad to see some familiar faces that helped me when I was first getting started. Thank you again 🙂
Quick question:
Getting a strange error when trying to scan for Bluetooth advertisements. Any permutation of self.ble.start_scan() (e.g. self.ble.start_scan(ProvideServicesAdvertisement)) returns an object that I can't iterate over.
for advertisement in self.ble.start_scan(ProvideServicesAdvertisement):
<do stuff here>
When I try I get the following error:
File "adafruit_ble/__init__.py", line 262, in start_scan
File "adafruit_ble/advertising/standard.py", line 180, in matches
File "adafruit_ble/advertising/__init__.py", line 298, in matches_prefixes
TypeError: extra keyword arguments given
Anyone else have this problem, or know where I can look to troubleshoot?
PS, the examples at https://docs.circuitpython.org/projects/ble/en/latest/examples.html don't appear to work either. :/
are all your libraries up to date, and what version of CircuitPython are you using?
Are there any tutorials available for LoRA projects (not LoRaWan)?. Not sure how to integrate data coming from, say a LoRa feather to another LoRa feather and then send that info to a computer or the web.
Without LoRaWan, it's basically a point-to-point link. Send and receive packets, basically.
Hi @young cove 🙂 I'm using the latest version of CircuitPython, but I think I forgot to check for new versions of the Adafruit BLE Libraries.
Totally solved. My bad. Thanks again @young cove 🙂
great!
These examples may be helpful. They are all LoRa, not LoRaWAN https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/tree/main/examples
yeah, that was my understanding, I was just wondering if there is a way to get those packets in a computer without going the LoRaWan route.
@chilly mesa you could double up, like wifi (or Ethernet) Feather + LoRa FeatherWing, or vice versa, and sent it to computer (or server) over network
You could, I suppose, talk to the LoRa chip directly with a USB-SPI interface, but you'd probably have to roll your own software.
uart might have some easier elements to cobble together (from a full-blown MCU /LoRa board or combo)
Yeah, that was the original answer: use an MCU on both ends and have the MCU on one end talk to the host computer.
@normal drift Have you tried https://github.com/ArmDeveloperEcosystem/lorawan-library-for-pico yet?
Wondering if Adafruit should have a guide on this topic..
LoRa -> LoRa -> WiFi/Ethernet bridge with two of the new radiofruit feathers
LoRa feather -> UART would be nice too for data science applications
A lot of ways to slice-and-dice it:
• Radio Feather + Ethernet FeatherWing
• Radio Feather + Airlift FeatherWing
• Pico W + Radio FeatherWing
• ESP32-* + Radio FeatherWing
ethernet tls would be nice, as would CYW co-processor 😉
Radio Featherwing -> ESP32 would be a great idea (as esp32 can do WiFi and BLE)
@umbral oxide CYW co-processor?
the wifi from Pico W
hard to be cost-competitive with that though, compard to Raspberry Pi org, not sure if there are any licensing issues
i havent checked in a while if Wiznet released their ipv6 ethernet IC
wiiish it was a SoC with a (rp2040?) co-processor to also run mbed tls
so the TLS lib and crypto apis don't need to sit on the main mcu
Yes, it works well.
Has anyone ever used RF69 to control Stepper Motors using AccelStepper library? I'm having some serious trouble getting movement although I'm receiving the correct joystick data.
I think I got it, I needed to run more instances of stepper.runSpeed()
Does anyone know if there's a difference between RFM95/RFM96 radios with and without the metal cover?
For example, https://www.adafruit.com/product/3072 has a cover, while https://www.adafruit.com/product/4074, using the same chip, doesn't. This seems to be the only RFM95 on Adafruit's store that doesn't have one, but my local distributor has other models without one, presumably with older photos from Adafruit, because the same products do have one there.
I believe the shielded one is a certified module while the other is not
Certified as in the W model for sale outside China?
If you zoom in on the shielded module it has an FCC ID
Certified meaning it meets the requirements required to be used in end products by the FCC
The unshielded module lends me to think that it is not certified for end product use
Would the RFM69 not need the same certification? There doesn't seem to be any version of that with a cover on it
Maybe there was just more room on the cover to put the FCC ID? 😉
It doesn’t appear there is a certified RFM69 module. I don’t know if it technically requires certification because it only operates in the ISM bands vs the certified module which also appears to support 2.4GHz which does require certification
I'm wanting to create a smartish Phone I'm unsure what fona board will work in Australia on the Lte/4G/5G network any info would be helpful thanks
While there are a variety of 4G/5G modules available (uBlox, SimCom, etc.) for a variety of countries/bandplans, I don't know if any of them are available as FONA modules specifically.
The FONA boards are (AFAIK) all based on SimCom products, so the minimum effort shift would presumably be to a more modern SimCom module. There's some discussion on the subject here #help-with-hw-design message
hey all. stupid question: can an arduino be used as an rfid transmitter?
let's say i know the serial number (wiegand id) of a key fob. can i "beam" that id at a reader from several meters away?
Sounds like you’re describing an active rfid tag or an rfid beacon. While it theoretically is feasible to do with a transmitter, I don’t know of any such projects to reference as most commercial active rfid tags used proprietary or encrypted protocols for communication as a security feature…
The flipper zero for example can emulate nfc tags. But only in near field. Beaming a magnetic field that far away would take a considerable amount of power and engineering. Or it might be downright impossible if the communication is bidirectional
Gotcha. Just to help my understanding tho, when an rfid reader beams energy at an rfid tag, it becomes energized and transmits it’s data, right? How much energy is that? I’m saying, how can I energize an rfid tag on my own, but with just a bit more power so the transmission range is increased?
There are two kinds of RFID tags in common use, low frequency 125kHz, and high frequency 13.6MHz. The basic idea is you transmit on their frequency and they receive it and rectify it to obtain operating power.
I guess you could make a more powerful reader, but you might end up overloading and possibly destroying NFC tags
Since the tag communicates by tapping power from the field in pulses, a more powerful reader would probably be unable to detect the changes from a card that wasn't in the near field
@primal warren Ok so that project is done but now I'm on to a new perhaps the hardest project I've ever even thought about. I'm trying to build a remote controlled rocket with rocket candy fuel using RC communication. Electronics weight limit is 300g
fuel weight limit is separate
It's unusual to have remote control on a rocket per se. Even if they're actively guided (which is hard), that's usually done with an onboard controller to keep them either just going "up", or on a planned trajectory. It's a very fast system, so doing it by remote control would often mean it goes sideways before a human could see what's going on and react to it.
How do we make a rocket dropped from 500m high self guide itself into a 10x10 square?
That's pretty hard
Oh and it has to land not too fast
Yeah, that's seriously advanced levels of control, especially with a solid rocket, which means it won't generally have variable thrust available.
Do also bear in mind that you are veering quite close to what the laws of various countries might call a "guided missile"...
Doubtful
Thats basically what we need to make
A miniature one
How on earth do you even start with that though
Figuring out the mechanism for steering and thrust would probably be one of the early issues. As I mentioned, solid-fuel rockets don't really have built-in thrust control because they burn themselves instead of have a liquid fuel you can vary the flow of. Maybe you can choke off the nozzle to reduce thrust? You'd also need either a gimbaling mechanism or some sort of side thrusters to aim it.
Presumably it would be under thrust while moving upward, and then returning downward just under the pull of gravity. So thrust vectoring is probably not useful, but steerable fins or somesuch could aim things. The tricky part is having the rocket a) figure out where it is, b) where it wants to go, c) which way it's currently headed, d) what its current orientation is, e) what correction is needed, f) the amount of time available to make that correction, and g) how to command the actuators to achieve that correction (if possible). Every single one of these steps is complicated.
Hello, Im trying to get this open-source GS working: https://github.com/maholli/PyGS/tree/main/code, but when I run the code, I keep getting the following error:
Is there a way to make a sub-ghz radio to use.. more.. power? Trying to debug a power issue, and i need to make it use more current, but i can't increase the PA output level.
The usual way is to add another PA stage.
You just want it to consume more power without increasing the radiated power? You can just put a resistor of the appropriate wattage and value across the power terminals.
To simulate pulsed power, you can use a mosfet and resistor that can pulse the power rails
Henlo Frens,
I'm currently working on robots for competitions, but every time we go to an event, the 2.4GHz wifi channels are used up beyond usefulness.
Now we cold switch to 5GHz, but that would bring down range and object-penetration significantly.
Since the robot doesn't send all too much data I was thinking of going 900MHz or similar.
How does one go about doing this?
Do you just grab an xBee and slap a network interface through it?
Will other devices interfere?
I'd look at an RFM69 and one of the protocols RadioHead supports, or possibly an RFM95 and LoRa.
There's always a chance of interference, and various ways to mitigate it (the 2.4GHz spread spectrum devices are pretty robust, but as you've seen, there is a limit)
ooh yeah
thanks for the leads!
You also might consider UWB radios like Decawave, as I imagine those would be pretty tolerant of interference.
Hello all. I have just got my hands on the Adafruit Feather RP2040 with RFM95 LoRa Radio - 915MHz - RadioFruit and STEMMA QT
But though I can load a micropython UF2, and see the device in the Repl on Mu, I can't seem to mount it as a drive and load lib Files. Any idea?
There was no flavor of Micropython for this board specifically, so I used the pi pico uf2
With MicroPython, you should be able to access files with Thonny
Not mounted there either.
the pi nas is a NAS device on the network
did you disconnect it from Mu first?
and in the Thonny Run menu, configure the interpreter?
that sounds illegal
and very much like a guided missile
No, it is allowed
ah it was mentioned already nvm
If you looked at the UK amateur rocketry, it's allowed
Maybe I misunderstood however it sounds similar to Mark Rober's rocket from a different altitude and fuel. Even he had to stop the landing as it would be too much like a missile
Fortunately UK and US laws differ greatly
And there are specific masses and constraints in place
The missile knows where it is at all times. It knows this because it knows where it isn't. By subtracting where it is from where it isn't, or where it isn't from where it is - whichever is greater - it obtains a difference or deviation. The guidance subsystem uses deviations to generate corrective commands to drive the missile from a position where it is to a position where it isn't, and arriving at a position that it wasn't, it now is. Consequently, the position where it is is now the position that it wasn't, and if follows that the position that it was is now the position that it isn't. In the event that the position that it is in is not the position that it wasn't, the system has acquired a variation. The variation being the difference between where the missile is and where it wasn't. If variation is considered to be a significant factor, it too may be corrected by the GEA. However, the missile must also know where it was. The missile guidance computer scenario works as follows: Because a variation has modified some of the information that the missile has obtained, it is not sure just where it is. However, it is sure where it isn't, within reason, and it know where it was. It now subtracts where it should be from where it wasn't, or vice versa. And by differentiating this from the algebraic sum of where it shouldn't be and where it was, it is able to obtain the deviation and its variation, which is called error.
Sorry..... I had to 😁
Would this qualify as a dipole antenna?
Kinda-sorta. You could think of it as either that or an antenna with a counterpoise.
Normally a dipole is fed with a balanced signal, and that board provides an unbalanced signal. You can convert between them with a device known as a “balun“, but the counterpoise is probably simpler. Looks cool, I like it.
I see! I'm not sure if anything that fancy is worth the effort, because my expectation is that even a single antenna will probably be sufficient. But I'd definitely be willing to put in almost no additional work for any kind of benefit 😉
I could also put a grounded metal plate below the antenna, that would probably have a similar effect then, I guess?
Yes, that would work too.
You'd want the antenna perpendicular to it, so it would act as a ground plane
Is a red triangle a bad reaction? 🥺
No, I think it's just a different style of "up arrow" icon.
Oh 🙂
But still the amount of engineering would be insane.
You would have to find some way to effectively guide the rocket. Fins may not work very well at a slow descent speed. And you need to find some way to actuate the guidance system.
Is there a straightforward way for hobbyists doing radio stuff to make sure not to interfere with sensitive electronics (like medical equipment)? Something like “only use this amount of power to transmit”?
Using only FCC-certified radio modules would be a good start, at least. But it's hard to guarantee no interference without a full testing process.
Hello. I have 2 pairs of 315/433 Mhz transmitter / reciever (one 315 and one 433). How can i check if they work? Becouse i can't make it communicate. I tried 3 diffrent libraries and on all i just see empty serial console. I think they can be broken, becouse i dont't know any other reason why they both not working. I already trying different pin, different wires and even powering from external source, to make sure it have enough power. I tried even using my car key to check if it prints something, but nothing. Can i make sure that they are good or broken?
Okey, i gave up with this terrible thing, its almost random high and low values, completely noisy signal at reciever output pin (still not sure if it is working or not).
Is there any 315 Mhz / 433 Mhz radio modules that i can easy use? And it have only 1 pin for data (i have limited number of pins)?
I've played with those, and had trouble with the UHF being radiated causing my circuits to have problems (to the extent of frying a microcontroller in one case)
That's really weird.
I don't see how it could fry a micro
A short jumper wire makes a very efficient antenna at 432MHz
I tried this https://www.instructables.com/How-to-test-RF-transmitter-and-receiver-before-pro/ and it is just a random flashing in my opinion (weird thing is i have both 315 and 433 recievers, but only one transmitter, but both recieved are affected with my transmitter signal)
Maybe it is not good visible on this video, but both leds keep "pulsating" even when i am not sending any signal.
And when i start sending 0 or 1 led just change state for few miliseconds and thats all. I was thinking that sending 1 witll make reciever pin HIGH and sending 0 will make it LOW, but it definitely not working like that.
So i just want to give up with these crappy boards and buy a better module, but can't find anything good with i can replace it.
It's possible that the receiver is doing some adaptation to the signal strength, so if nothing is transmitted, it just ends up amplifying the noise up until you get random output. But if you have a quickly-changing series of 1's and 0's like real data, then it'll be able to lock on to the correct threshold and output the data. This is why people use things like Manchester encoding to have a "balanced" signal with a consistent power level no matter what the data is.
Those boards look like the cheap SAW ones I was (briefly) using. I ended up switching technology.
I will also switch technology if I can, but I don't think there is any other way. I want to make a module that sending signal right after recieve power source. Don't have much time to eg. connect to wifi hotspot or something, i need to use a connectionless transmission.
I find the RFM69 modules quick and well behaved. I've also used some of the 2.4GHz spread spectrum modules, but they can take a few seconds to synch up after power-on.
I’m considering using radio to measure distance between objects a few millimeters apart (directly, by using changes in signal strength as transmitter and receiver move). Is there a practical limit to how precise this approach could be? I’m thinking that with an op-amp and good ADC, I could actually get really precise measurements
It will definitely depend on the frequency you use id imagine. Some might be trivial. You will probably get more granular results using VHF signals
Not sure what frequency range you’re talking about
Ultrasonic though tends to be pretty common
Though looking, ultrasonic seems to be good for 2cm up to 4m
I’m looking for micrometer precision ideally. Is that going to require crazy THz frequencies or something?
You’re talking about LiDAR at this point
Because those are at high enough frequency (millimeter wave)? I thought my situation is different because I control the transmitter and receiver
LiDAR is just crazy accurate
Though that one probably isn’t a good example
Those scales are multiple orders of magnitude off from my intended use 🙂 micron precision within centimeters of distance
I’d probably venture that micrometer accuracy measurement is going to cost quite a bit to develop
It might be difficult to obtain at a hobbyist scale
That sounds plausible for sure
But what I’m talking about is easier and probably more capable than something like lidar or ultrasonic sonar. There’s no need to wait for a reply, timing doesn’t have to be precise, etc. just signal strength
You’d have to have a system that polled the ADC fast enough and could use the data fast enough.
That might be difficult to achieve with a microcontroller
Not impossible but definitely a huge learning curve to get there
I’d recommend looking at a jfet op amp with a GHz GBWP (Gain Bandwidth Product)
Something like an LTC6869 I think has 4GHz GPBW
That op amp would be a great place to start
I’m not sure if you could properly receive the signal with a single op amp front end, but if you can there is a variant that has a single op amp https://www.digikey.com/en/products/detail/OPA858QDSGRQ1/14124016
@half plover thank you!
You might look into inductive (eddy current) position sensors.
Bear in mind that with RF, everything would affect signal strength at that kind of precision besides just distance. Like, just your antenna swaying a micrometer in the breeze, or a chance reflection of the wave from a truck passing by on the street, etc.
Oh yeah this is a great suggestion
Maybe a capacitive sensor would also work since capacitance changes with distance. You could measure the frequency that it oscillates at in an RC or LC oscillator, and determine the distance. But inductive might be the better way to go since those sensors exist, are common, and I think are used in the vibration analysis industry to measure small distances when something is vibrating.
I've been playing around with collecting data from zigbee devices (eg aqara temperature sensors) via the phoscon-gw API. I've run into some complications, and so I have many questions, but let me start with some basics.
Let me preface this by saying that, I'm pretty good at doing network searching, and I've been surprised at how little tech level info I've been able to find about how zigbee works. A pointer to some good tech docs would be welcome.
As best I can understand it, a zigbee "end device" is kinda autonomous, in that it spends most of it's time sleeping, and periodically wakes up to sent data to its server. And it seems that the criteria that it uses for waking up/sending vary from device to device. Am I right so far?
These Aqara devices I'm working with will work flawlessly for long periods, weeks, longer. But will without warning just stop sending their data. From the server/gateway dashboard it appears that the device is still there (aka "reachable"?) but it just won't send.
And I'm kinda stumped on how to debug this "failure".
Kind of: Zigbee is a "mesh" network, so "end" nodes will often do routing as well, so they'll receive packets from a nearby node and rebroadcast them.
Is this making any sense? One thing I think I want to know is what is the criteria/trigger that these aqara devices use for sending? Why would the stop sending?
@primal warren Yes. Although what I've read suggests that the "end devices" are optimized for long battery life, so they usually do not do repeating.
It sounds like "sending" is covering more than one concept. There's transmitting radio information, and there's forwarding information from the local interface. Since it appears reachable, I'm guessing it's still transmitting. But perhaps it has ceased generating its own traffic from local data.
Zigbee does have the concept of "reduced function devices", which do not do forwarding, but I'm not sure whether that concept is in use (as you said, detailed information is tricky to find)
Note that there are flavours of Zigbee as well. For example, DigiMesh is Zigbee compatible, but implements sleep functionality on routing nodes to save power.
@primal warren Yes it definitely seems to have ceased generatiing it's own transmissions. I've found that I can force it to "update" by short pressing the hardware button on the device. And maybe that's just what I have to do. But it feels like it would help me if I understood what the devices "rules" are for when it chooses to send its data.
Perhaps it would be useful to know more details about your end node. Is it Zigbee + a local MCU or what?
It's an Aqara temperature/humidity/airpressure sensor. (I can dig out the model number if that's useful.) It's "connected" through a conBee II dongle, attached to a raspberry pi, running the PhosCon-GW gateway software.
I pair the device with the gateway using the gateway's web app. And I'm collecting data from the gateway using its API called from Python scripts.
This one?
As near as I can tell ( after a lot of testing and experimentation) the gateway, and my scripts are working as expected. The problem is that the device is just stops sending new data to the gateway.
Monitor indoor temperature/humidity with Aqara wireless smart temperature humidity sensor. A Zigbee/HomeKit/Alexa temperature humidity sensor for your smart home.
Hint: look for an FCC ID sticker (like "2AKIT-WSDCGQ11LM") and do a search on that string
I like that idea. Thanks. I will.
The one I looked up uses a single-chip solution (NXP JN5169 https://www.nxp.com/docs/en/data-sheet/JN5169-001-M0X-2.pdf)
Apparently that chip has a few issues, and can stop generating packets if it exceeds the maximum number of simultaneous data requests, it receives a request to leave, it gets a factory reset, or the watchdog timer expires. The newer Azurewave AW-CU479 apparently is more reliable. That doesn't help you, however.
Apparently you can access a serial data stream from some of the test points on the internal board, where the module will tell you what is happening.
There's some detailed information available here https://www.nxp.com/docs/en/user-guide/JN-UG-3101.pdf
Aha, yea. Searching on "FCC ID: 2AKIT-WSDCGQ11LM" The most interesting info I've found yet. Thanks. That IS the number on the back of the device I have.
Changing to a more reliable device is not out of the question. Although I already have about a half dozen of these Aqara ones, so I'm gonna keep trying to figure them out.
Thanks for your help.
Hello everyone, Is it possible to detect the lora usage from a lora gateway?
Like if two lora devices are transmitting and receiving in a area. Is it possible for a stranger to detect that lora usage from a lora gateway?
Maybe. I think that a typical gateway will have some defined parameters that it will listen on, with regard to channel frequency, modulation mode, etc. So it might not be able to pick up every possible LoRa variant that someone might be using. That could depend on the gateway, though... some of them might be fancy enough to scan the whole waveband simultaneously.
Can i connect lora gateway to any cloud. For example arduino iot cloud or aws?
I want to show the detected signals on a website or a mobile application.
I'm not sure. Often the gateway would just transmit the received data itself, if it was LoRaWAN. It might or might not do anything with signals that it doesn't know what to do with.
Can we decrypt that data?
Depends on the device sending it. There's nothing keeping a transmitter from sending encrypted data with whatever uncrackable algorithm they want to use.
Ohh
I actually don't think you'll have to look very far. Microphones actually have to measure extremely small displacements in order to work, so that exists. Also, certain capacitors have usually undesirable microphonic effects, which means they can pick up extremely small amounts of vibration or flex
Meaning the capacitor would discharge at different time intervals?
It would have a different time constant with a known resistor or it would have a different resonant frequency with a known inductor.
but inductive sensors are readily available, so I would use those
I’ve been learning more about these, and I can’t tell if they could handle multi-centimeter distances between the two objects
I think they can, depending on the coil diameter. However, note that you'll probably need to calibrate the heck out of them if you need actual micron-scale accuracy. They'd likely be sensitive to that level of motion, but there's no actual distance ruler involved (like there would be with using the speed of sound or light as a reference), so you'd have to translate the measurement into a distance yourself.
oh, you want micron-scale accuracy at centimeter distances? That's going to be pretty hard. Maybe combine sensors and/or maybe use some sort of smart optical thing (like an interferometer).
although there are sliding distance sensors that can be pretty accurate and cheap
maybe look into the type used in digital calipers
they have a resolution in the 10s of micrometers
Hey I have a couple questions about how actual radio people would pronounce some frequencies if spoken
Could someone tell me how to pronounce “15234002hz” in a clearly understood way? Like would I say “one five two mhz three four zero kilohertz and two hertz” or would I say “one five two point three four zero point two mhz?hz?“? (I’m not even sure how it’s said when you say point)
Is there some guiding standard like the phonetic alphabet on how to most appropriately convey a frequency over voice?
like it’s not a GREAT idea to say the letter O when you mean to say ‘zero’
sorry if this is pedantic, but I’m writing some software and need to know how to feed it to the text to speech engine
You would almost certainly only say the unit (MHz, kHz, etc.) once at the end rather than giving a combination of them. Personally I would pronounce the given example as "fifteen point two three four oh oh two megahertz". But I do not know if there is a better, more official standard among people like ham operators.
Also, that extra 2 Hz probably does not matter unless you need to be exact. So just round up and say something like 15.234MHz
and I would also say "fifteen point two three four megahertz"
If you want to be fancy, you could have "decimal" instead of "point". If you want to be ridiculous, you could say "radix".
Heya folks. Bouncing around projects and thought I would use some Waveshare SX126X pico boards I have to finally play with radio. The Waveshare examples aren't for CircuitPython and I have run into a few issues. Does anyone have experience with these radios?
Trying to get working on CircuitPython so I can experiment...then I will buy some of the FeatherLora boards because they look awesome.
I think they use the same sx126x ic as the rfm modules that have circuitpython support
Maybe
If the ics are the same, there's a good chance they're compatibke
@edgy folio i'm reading through your code and looks roughly like what i'm doing. but theres a few differences between what i'm doing and the code you have
i have a continuously playing animation on the neopixels, they just change to a different animation when certain packets are recieved
the delay between each frame of the neopixel animation is 0.2 seconds which i listen for packets & process the packet if one is recieved
i suspect i'm dropping packets when i'm sending the neopixel data over the data pin
if you have any suggestions on a better way do this
-- for anyone else with suggestions, I'm using circuit python.
not sure if i should have psoted this in #help-with-circuitpython
@restive fjord yes circuit python would be a better place since that's the language and libraries. radio could also include RC, HAM, etc.. 😉
or LORAWAN yes but the help channels are generally centered around the underlying programming languages used.
lemme go move it
Ahoi! I'm pretty new to this BLE stuff and playing with a Bluefruit Feather 32u4 and a Raspberry PI4 on the other side. I wanted to write a python app to connect to the feather and send bytes (UART) but I'm stuck in chaos. So I went back to the terminal and played with the bluez tools to see what is what. Now I've managed to connect to the feather via gatttool (took me a while to use the -t random switch). But, well, now I'm stuck understanding how to send bytes to the feather. I know that I would do something with characteristics but I'm alread stuck in identifying which characteristic does what. I get a list of 12+ characteristics, with just UUIDs and no discernable hint on which does what.
Long story short, I'm stuck, basically have just the slightest idea what I'm doing and am looking for help. Am I even in the right place here?
PS: using the mobile BLuefruit app connecting and sending/receiving stuff in UART works like a charm.
I'm using the "standard" UART sketch from Adafruit on the Feather, actually called bleuart_datamode
Ok, the blame is clearly on me. I found https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/uart-service in the meantime and wasn't patient enough to read the documentation closely. It clearly states at the top how to find the correct UUID
😅
Ok, I can see that my connection attempts (currently with bleak) fail with authentication errors. Resulting error is "disconnected early". But, this nordic/feather doesn't use authentication o_O what is going on here?
Output from btmon:
Handle: 64
Random number: 0xabcddb36eb794a5b
Encrypted diversifier: 0x41fa
Long term key: 828ade9031e4c803d21215bca9f0b827
> HCI Event: Command Status (0x0f) plen 4 #35 [hci0] 504.919704
LE Start Encryption (0x08|0x0019) ncmd 1
Status: Success (0x00)
> HCI Event: Encryption Change (0x08) plen 4 #36 [hci0] 505.069090
Status: PIN or Key Missing (0x06)
Handle: 64
Encryption: Disabled (0x00)
< HCI Command: Disconnect (0x01|0x0006) plen 3 #37 [hci0] 505.069157
Handle: 64
Reason: Authentication Failure (0x05)
this happens with the adafruit BLE python library
I gave up. Found a nice python wrapper around gatttool. https://github.com/peplin/pygatt this works for me. No idea why the other implementations don't.
Could you post the program you were using on the Pi 4 side, and exactly what you set up on the Feather side? An issue in the Adafruit_CircuitPython_BLE library is probably the best place. Your Raspberry Pi OS should be up to date, and so should bleak and the library. We recently updated the version of bleak that was used with the library.
Thanks for the response. Will take a bit till I put everything together in a paste. Maybe tomorrow.
Also, I’ll double check the libraries and OS. I’m pretty new to reading C++ APIs (and even more so to BLE) so it might as well be something I’m missing, like how to properly setup the random config when connecting to BLE.
How do I design a wideband RF power amplifier?
Actually nevermind. I can't transmit voice on some of the lower bands with only a technician license
So 🤷♂️
Actually I might want to do something with 50MHz so
Is a homemade 20W transmitter practical to make?
Making the basic transmitter isn't too tough (couple of vacuum tubes), but the modern regulations require it to be a well filtered waveform, without splatter and harmonics, and sometimes the output filter ends up being the hard part.
I don't have any tubes. (And I don't want to mess with the HV power supply required). For a narrow frequency, a Class C amp would make sense, but if I want a digitally tunable amp or a wideband amp, I have no idea how to do that.
Maybe class A or class AB, but I've never seen that
They've both been done, in solid state
Some BLE questions. I am trying to setup a service to advertise by altering the ble_json_peripheral.py and ble_json_service.py examples. But I am running into an error.
File "<stdin>", line 30, in <module>
File "ble_json_service.py", line 17, in __init__
File "adafruit_ble/services/__init__.py", line 49, in __init__
NotImplementedError:
>```
Here is the ble_service.py
```from adafruit_ble.uuid import VendorUUID
from adafruit_ble.services import Service
from adafruit_ble.characteristics import Characteristic
from adafruit_ble.characteristics.int import Uint32Characteristic
class SensorService(Service):
# pylint: disable=too-few-public-methods
uuid = VendorUUID("f1f8a0ea-f7f7-11ed-b67e-0242ac120002")
sensors = Uint32Characteristic(
uuid=VendorUUID("f1f8a388-f7f7-11ed-b67e-0242ac120002"),
properties=Characteristic.NOTIFY,
)
def __init__(self, service=None):
super().__init__(service=service)
self.connectable = True```
Anyone have an example of how these work together?
I'm having issues with the Adafruit RP2040 with RFM95 wireless. I can get some simple RX TX code working just fine, but anything more than that has been a struggle. The first thing i did, was add a voltage divider to the VBAT and GND and that seems to be working. As soon as I add the I2C cards (even before writing code with them) the program would hang on rf95.waitPacketSent() If i unplug the i2c from the QWIC connector, it goes back to functioning again as expected. For context i have 2 i2c breakouts plugged in. BM085 TempPressure and BNO085 9DOF. I can't get these programmed because once they are plugged in, Arduino seems to have challenges talking to the board.
So with i2c it freezes 100% of the time, without it, it will freeze after a few packet sends. rf95.waitPacketSent()
Can you explain the voltage-divider part of your design? That could be fine or it could be a bad idea depending on what you're using it for.
For what it’s worth: I’ve switched to the feather nRF52840 express using circuit-python and everything works like a charm. I’m feeling way better with Python, so I’m not sure if I will go back to the 32u4 to hunt down the issue
No problem, but we'll keep this in mind if someone else has trouble.
Does anyone know of libraries that support LoraWAN for a Raspberry Pi with ans RFM9x module? If so, can you jump into this forum thread with a link to it. Thanks https://forums.adafruit.com/viewtopic.php?p=973781#p973781
The Circuitpython tinylora library is deprecated and does not work anymore. I am not aware of any LoraWAN libraries for the PI. There are a few C libraries for the RP2040….
Do those things not just use UART?
No - SPI
Unless it's something super nonstandard I don't see any reason you can't just use the SPI interface on the Pi.
Sure, if you want to write the code. I was just asking a library already existed.
The rfm9x works fine with a Pi. Just looking for LoRaWAN support.
I am really puzzled that I cannot find any examples of using a Raspberry Pi with an rfm9x board to create a LoRaWAN node. I wonder if I am just looking at it incorrectly or is no one actually doing this. There are some old libraries based on LMIC that may have worked with TTN V2 and earlier, but they have not been updated in several years. for example https://github.com/pmanzoni/raspi-lmic. The MCCI_LMIC library works great for the Arduino IDE and I suppose the "raspi-lmic" library was an adaptation of the earlier version of this. I'm just surprised there does not seem to be anything more recent that would work with the current TTN V3.
@normal drift https://github.com/btemperli/LoRaPy ?
I spent some time with it last year, but hit a lot of roadblocks and never got it to work (but that's probably more on me than anything)
Thank you! I will give it a try
There is even an updated fork https://github.com/ColbySawyer7/LoRaPy
Making progress. I can get a "Join Request" to be seen by my gateway and forwarded to TTN.... Things get a bit confused (or actually I get a bit confused) after that, but this is a big step forward! Thanks for the link.
Are there any words or phrases for talking about the shape of an RF “shadow”?
I've heard "urban canyon" used for the effect where GPS signals are blocked by tall surrounding buildings, but that's a fairly specific case.
Could you run blinka with the circuit python rfm95 library? I think those have lorawan support.
Yes to Blinka, but there is no current LoRaWAN support in Circuitpython. There was limited support via adafruit_tinylora, but it is now deprecated since LoRaWAN migrated to TTN V 3.
what can I do from the ARRL handbook without a ham license ? make something that receive anything and uses the open-sources frequencies like 80-255Hz/12-14mhz/900mhz/2400 Mhz(such as lora/5g/bluetooth etc)/490-900 ThZ ???
Yeah, the hundreds of THz band is fun to play in, no license needed.
I admit that 80-255Hz and 490-900Thz was a bit of a joke
cuz you cant really help transmitting on these frequencies and Im not really sure if boucing off lights rays count as transmitting
You can build receivers for most anything you want, with a few narrow exemptions for things like the AMPS bands (which are no longer used anyway)
isnt local am/fm override allowed for a place of business since there is no way you can interfere with very powerful commercial radio stations transmitters ? isn't that how they do intercoms in stores like walmart ?
No, you are not allowed to override/jam existing signals.
Intercoms often use one of the business bands.
Or are wired, or potentially just run over the network.
My biggest concern I guess is to be stuck on a single frequency like with these crystals
because licensed users have priority over unlicensed on license-exempt bands so if a source near me uses says 2400.8 I cant use it and have to switch but being stuck on one frequency kill the whole project
The modern solution for this is like SDR right ?
Or DDS or analog tuning or hybrid or or or or
There are lots of ways to address frequency setting.
Also, crystals are cheap, in the old days, it was common to have a few of them so you could choose a frequency that was currently unused.
SDR changes nothing about the licensing of different bands. It's more of a difference of approach in tuners, which today tend to prefer broadband.
Clock generators and PLLs can solve the crystal problem. I see the problem as having matching networks and filters that only work on certain frequencies or bands
I want to build an SDR (yes very ambitious project) or a digitally controlled HF ham transmitter, but I don't know how to get enough power to an antenna if I'm using some sort of digitally tunable network (which I think will use varactors)
I asked mostly so I can know what to look up in the huge arrl book 🙂
Are nordic nrf consdeiered a kind of SDR since you can choose a channel and hence change the frequency or they are too integrated / not configurable enough to be considered SDR-like ?
Generally, no. SDRs provide more raw samples with the data decoding happening in software. Having selectable channels or frequencies is more of a "normal" radio transceiver feature.
If I seem to talk about two different things it's normal. Just trying to understand radio while complying with canadian laws
receiving I can build my own thing, transmitting I can't has to be on approved list, under 0.5W like https://sms-sgs.ic.gc.ca/equipmentSearch/searchRadioEquipments?execution=e1s3&index=6. It's not a frequency thing like the US
There are frequency limitations as well
bah I guess Ill do the ham license then. Will prove that I know electronics a bit too ....
hi all....i don't see it in the specs/description: does this work with Pi Zero W?
The latest Raspberry Pi computers come with WiFi and Bluetooth, and now you can add even more radio options with the Adafruit Radio Bonnets! Upgrade your Raspberry Pi with a LoRa / LoRaWAN ...
I don't see why not. It's basically an SPI and I2C peripheral with a few other GPIOs.
ack, thanks!
What ARRL chapters should I read if my building is surrounded by concrete high-rise around and Im trying to figure out what bands might work / what size antenna I might need for ham ?
The "Propagation" chapter (19 in recent editions) might be a good one.
The "Antennas" chapter (21?) is another good bet.
thanks Ill take a look. Trying to find out if Ill actually be able to have an ham where I am to see if its worth it to invest my time in a ham license. Also morse aint so bad to learn after all
long time no reply, (my apologies) Per Adafruit's documentation https://learn.adafruit.com/feather-rp2040-rfm95/power-management#measuring-battery-3122383
Note that unlike other Feathers, we do not have an ADC connected to a battery monitor. Reason being there's only 4 ADCs and we didn't want to use one precious ADC for a battery monitor. You can create a resistor divider from BAT to GND with two 10K resistors and connect the middle to one of the ADC pins on a breadboard.
This is what i did.
Everything works fine in CircuitPython, but arduino seems to lockup.
The issue i'm having now, is the amount of data i need to transmit is causing a slight delay between packets. So, i'm trying to figure out the best way to compress the data.
UPDATE: I decided to give it another go. and i recieved an error on RH_LoRaFileOp which their documentation explains there is an issue, but the version they want to install is 6 years old. So time for a new solution. 😦 I don't think i can use the LoRa boards from Adafruit for this project, they don't seem tobe working with this library, and circuit python isn't fast enough for my application
Hi, I have a bit of a technical question regarding Ebyte's E32 LoRa modules.
Ebyte's documentation seems to make no mention of a maximum packet size, however it seems like the module is segmenting the transmitted data automatically into chunks of 59/51 bytes like the LoRaWAN Regional Parameters document recommends for the EU443 band at a 1.2kbps data rate.
Is this a limitation that applies to the "LoRa modulation" as a whole due to RF regulations, or does it just apply to LoRaWAN for the same reasons ?
I'm mostly trying to figure out if I can avoid having to add these packet size tables to a driver I'm working on.
are you considering HF, as opposed to VHF or UHF? Do you live in one of these high-rises, or are you lower? Do you have a balcony? Is this US or Canada (just interested from a licensing pov)
That may be a LoRaWAN limitation https://lora-developers.semtech.com/documentation/tech-papers-and-guides/the-book/packet-size-considerations/
no idea yet, Ill take what works / Im in an high-rise but Im at the poor person/lower floor (3rd) / I have a balcony but if the antenna too big landlord probably going to whine / Canada
Im checking if an antenna will likely work here and if there are still ham in my city before I invest my time in it
is there any way to speed up the sending of data in circuitpython for the RFM95 module? seems to be related to the number of bytes being sent, i'm sending around 192 characters, and there is a slight delay between sends. If i send a single number it's fast, but if i send a string of data there is a delay. Not sure how to improve performance.
Note: I'm not able to get arduino (radiohead) library to work on this board. RP2040 RFM95. CircuitPython works fine but the send is a bit slow
And has XBEE stopped making 900mhz modules?
Thank you for the link.
It seems like both the PHY and LoRaWAN have slightly different limits.
I stumbled on the following link that mentions different values related explicitly to LoRa.
https://lora-developers.semtech.com/documentation/tech-papers-and-guides/lora-and-lorawan#:~:text=Table 2%3A LoRa modulation characteristics
And when going over the "LoRaWAN® Regional Parameters RP002-1.0.4" document, I found this small blurp I missed that specifically point to a PHY limitation.
LoRa is an RF modulation technology for low-power, wide area networks (LPWANs).
In cities, there's generally 2m and 70cm activity, and those don't require large antennæ. For the HF bands, things are more subtle but often possible with creativity.
I was thinking of pointing out that the modulation itself doesn't impose direct limits (although the bandwidth/spreading factors can change the symbol density), but you do need a protocol on top of it to transfer information, and I'm not really clear on what protocols are available or what they're capable of.
Found a few kits that still can be ordered on digikey with several 900mhz modules/modems in them. lead time of 2 weeks. It just seems that generally 4/5 fo their products are marked obsolete/no longer made but depending on which ones they have replacements
Yeah, they seem quite permissive if you don't fill up their internal buffer too fast.
Regarding the protocol, I'm not sure.
I suppose you could implement a basic protocol, but even then it can be hard to filter out potentially unwanted data from normal traffic. :/
How long of a delay are you seeing? Can you post the code you are using to send the data? A 192 byte packet will take longer to send than a smaller packet...
For the Radiohead library, I was able to get it to work with the following pins#define RFM95_CS 16 #define RFM95_RST 17 #define RFM95_INT 21 and I had to do a toggle of the RESET pin beforinitializting the radio
digitalWrite(RFM95_RST, LOW);
delay(100);
digitalWrite(RFM95_RST, HIGH);
.25 sec per message
The code is pretty basic
# Initialise RFM95 radio
rfm95 = adafruit_rfm9x.RFM9x(board.SPI(), CS, RESET, RADIO_FREQ_MHZ)
while True:
data = "%s,%s,%s" % (
dof(bno), # Dof Data
altimeter_altitude(bmp), #Altimeter Data
battery_voltage(adc)
)
print(packet)
rfm95.send(bytes(data, "UTF-8"))
The data string is
-0.005005,-0.011963,-0.987122,0.159302,1.262690,-0.784932,-161.755127,0.128906,0.218750,9.746094,0.000000,0.000000,0.000000,-9.562500,-30.937500,-11.187500,26.45, 973.7,333.921,4.12
You have a print(packet) line in there -- how long does that take to print?
i have the exact setup you have but it sends 1 packet and hangs
without the send it takes no time at all. it streams data like i'd like to see on the send. i've removed it, but the receiver is still getting the same speed. If i replace the send data with a single integer it's pretty speedy.
So i feel i wouldn't see much more improvement in arduino then? I might need to go back to looking to compress the string to send the data.
I am not sure. I watched a video of a guy streaming telemtry from the XBEE and was getting a pretty speedy send rate. Is this something to do with the radio, microcontroller or the library itself?
I'm not sure -- I have not done any testing of the actual data rates.
This is the arduino code loop. ```void loop() {
delay(1000); // Wait 1 second between transmits, could also 'sleep' here!
Serial.println("Transmitting..."); // Send a message to rf95_server
packetnum++;
char radiopacket[20] = "Hello World # ";
itoa(packetnum++, radiopacket+13, 10);
Serial.print("Sending "); Serial.println(radiopacket);
radiopacket[19] = 0;
Serial.println("Sending...");
delay(10);
rf95.send((uint8_t *)radiopacket, 20);
Serial.println("Waiting for packet to complete...");
delay(10);
rf95.waitPacketSent();
}``` Basically just the send portion from the example RX TX example. It hangs on rf95.waitPacketSent() and won't loop
so you're not even using the waitPacketSent
not in this example -- I have a 5 second delay anyway
yeah, i don't want to wait. just want to see a steady stream of sensor data. I might take what you have and see if it works any different. Silly question, i haven't done arduino in a while, how to do you concat char[] data to the uint8_t type?
sorry -- that was wrong. I'm not sure I understand.
it's ok, i greatly appreciate the feedback and help
Good luck!
With the xbee module looked like he was able to simply write serial.println() and the module would send the data. curious how these lora radios are different from the xbees
@normal drift last silly question, the send isn't expecting an ACK, and its waiting for feedback is it?
in CircuitPython send() does not wait for an ACK -- send_with_ack() does
in Arduino the sendtowait() expects and ack -- sendto() does not
but that is using the manager that you have setup? which im' not using
I am using the datagram manager but not using the "reliable datagram"
sorry it is not a great simple example... as I noted., it was just what was handy and I wanted to convince myself the rp2040 worked...
ok, i was able to get it working (not sure what i did. Serial doesn't write out, but the packets are being sent... fun fact, still has the same delay i saw in circuitpython.
That's just sending a string the same size
@short nimbus If you live in a city of any size, or even in a smaller town, there are certainly going to be hams in that city. There are probably one or more clubs as well. https://apc-cap.ic.gc.ca/pls/apc_anon/query_amat_cs$callsign.actionquery will let you search for hams geographically. Take a look at https://www.rac.ca/. Check out your public library and browse through issues of QST (the ARRL magazine) and the RAC magazine, The Canadian Amateur. https://www.rac.ca/tca/
OK -- I made a simpler test example
oops -- I had commented out the waitPacketSent -- it also works with it
@acoustic field this bit rate calculator may help . it looks like the bit rate for the default setting is only 5468 bps so your 192 byte packet (1536 bits) will take .25 seconds to send.https://www.rfwireless-world.com/calculators/LoRa-Data-Rate-Calculator.html
This page mentions LoRa Data rate calculator.The formula used for this LoRa bit rate calculator is also mentioned.LoRa calculator takes spreading factor,code rate and bandwidth as inputs and provides data rate as output.
Good point: LoRa lets you trade off range, speed, and noise immunity in various ways.
It's optimized for range (LoRa means "long range") more than speed in most cases.
You can "try" adjusting the settings, but if I recall corecctly, that has not gone well in the past 😉
Normally when I'm looking for speed, I use something other than LoRa
it's for rocketry, so kind of need the best of both worlds, do you have any recommendations. I was going to give xbee a look see as well, but finding new 900mhz modules seems challenging
Xbee is more of a mesh network design, and you probably just need point to point.
I'd probably go with 432MHz to get additional range, maybe a simple RFM69 type module. A "belt and suspenders" approach might be appropriate, both send out your data via radio and write it into an SD card or similar. Then if you get some dropped data via the radio link, you can recover it later after your retrieve your rocket. And if the rocket gets lost or the SD card doesn't survive, you at least have the radio data.
can lora be as reliable as bt for short to medium distances? ive herd you can incorporate crc and many features to reduce packet loss but im more curious in real world tests. mainly looking for best wireless to try for greenhouse sensors and maybe so basic controls. in north America i believe we can only use 915mhz. i think bt would be faster in updating sensor and controls but maybe lora is good for this project too. also are there any lora modules that are cross compatible with other lora chips. seems thats loras limitation is the chips all have to be of the same type i think. wish there was at least a basic set of features that worked across all lora chips for interoperability
The base LoRa protocol is "fire and forget", rather than being a connection-oriented scheme like Bluetooth, so there's no built-in acks or retransmission of lost data. That could be layered on top if you need it, though.
Most LoRa modules will be using the same family of Semtech transceivers, so they should be pretty compatible if they are in the same country-specific frequency band.
thank you for the info, thats really good to know. i was under the impressing from all the videos i watched the lora had to be same model. glad to know now its based on the frequency
They have a fair amount of latitude, the same modules are used for 868MHz and 915MHz, you use software to configure the particular frequency to use.
and by software afaik it's preprogrammed channels so someone else loras might interfere with yours
I haven't had a problem with that, but I live in the middle of nowhere
Id like to know what to make of this, if it's any good, if it's actually a kind of schematic, if you can tell the voltage of the battery from this etc
That looks like a lot of processing for a little 8-bit CPU
there an adafruit breakout in it too. Not sure what to make of it. Just a random transciver on amazing seemingly made in a very hobbyist way with an extruded aluminum casing
I thought it was interesting to share it here because it seems to uses an arduino / the atmel of an arduino and at least one adafruit component(The SI5351)
Sounds like something with a lot of work in it. It's possible to do all that processing with some effort and clever coding.
the specs says it has 2000 lines of code whatever that mean (LOCs not really a good indicator or anything) so it seem like light software use
seems to be a clone of a clone of a qrp labs qcx modified 5W transceiver with the github ssb modding version
Does someone know how to scan for extended advertising packet with the adafruit adafruit_ble library ? https://github.com/adafruit/Adafruit_CircuitPython_BLE
start_scan has an extended kwarg that you should set to True
I tried it
Didn’t work
I also tried to increase the buffer
what platform are you using it on? nrf?
recommendation for a transceiver kit you can easily deconnect the transmit trace/lock it at hardware level and add sensors to (temperature/rain/etc) (like the qrp qcx) except not on HF bands ? (qcx is Available for 160, 80, 60, 40, 30, 20 or 17m bands and only for CW while I can only catch centimeters bands atm) ? In Canada you can listen to ham bands until you get your license. The goal is to start checking for antennas to see what I can receive so that when I get my license everything is ready to run ?
I'm confused as to what you want to do. Do you want to just receive now? Or are you thinking ahead to transmitting data? There are a lot of ways of transmitting data, but most use modulated audio or direct control of the carrier frequency. It's usually not just automated CW.
Basically I cant transmit at the moment. I was advised with the canadian basic license I can use a kit if I want and to get a transceiver anyway until then but not transmit/change the trace on the board (like by using a jumper). That will let me test antennas in receive mode only. For voice ham like 70cm and below since my apartment cant do RF. When I can actually transmit I'll have a radio already and just need to reconnect the trace/jumper and I know the antenna works so it can happens as soon as my card is in the mailbox
is it a regulation that you have to disable transmit? You can just not put it in transmit mode
I just feel like it is better to avoid accidents. Like you are cleaning the desk and the mic falls off and hit the ground transmit button first etc
also I have 100 peoples in my building so if someone transmit illegally I can show them it cant be me because it's disabled
most of the activity on the VHF/UHF bands is going to be FM voice. other modes are going to be rare
I’m running the python on a windows 10 desktop with a Bluetooth 5 adapter. I know that my nrf is working because I can see the broadcast on my phone and on my pc using the windows Bluetooth explorer app
I had the canadian FCC shows up at my house when I was 11yo (but it was the neighbor) and the first thing they asked was to see our radios and 2) if they could transmit 3) where the antennas were
So I feel like Id be safe from having a life-ruining 20k$ fine if I can prove it cant transmit and not get to question 3
along with circonstantial evidence (Im studying for it, it's free, why would I take a chance to disrecpect the law when Ill be able to legally in a few months etc)
My guess is that bleak doesn't do extended advertisements on win 10: https://github.com/hbldh/bleak I only tested it on rpi linux
(bleak is used by blinka bleio)
I just really want to have an antenna that works and is tuned by then. But I guess an sdr usb key seems the best choice so far. Since qrp are all HF kits
But ideally it would have been easier to pass the exam I guess if I actually had to assemble a kit
Bleak doesn’t work either
But I guess I will try on a pie 4
that sounds like the easiest way by far. ... looks like you should shoot for Basic with Honours
I cant do HF
Unless I buy an house etc and that seems very expensive just for an hobby
I cant even get digital tv belows 180 MhZ
you can do HF out of the apt. You can do low-power HF in the apt, but it might be frustrating. People do HF from their balcony
but it really depends on what you are interested in
I was just thinking that like on the qrp kits if I have to install an adafruit SI5351 myself, connect it to the op-amp and the antenna solder the caps/resistors etc I would learn much more
vs getting a pre-assembled unit or say a baofeng/yaesu portable radio
so you can make a qrp kit, and operate it from the park or a parking lot, etc. picnic table
yeah but they are CW and HF both thinks I'll probably never do
the qrp only does CW in HF bands
you can get qrp radios that do digital, e.g. FT8 mode
Im In canada btw, 6 months balcony blockage because of snow hurricanes 😄
most of us apartment-dwlelers ham have to get portable unit / vehicle stuff with mag antennas
and even then it's limited by temperature / weather
sorry if it's confusing I just started studying that field
I just dont want to spend like 2000$ and end up realizing that's it's impossible for my apartment to get anything in from any band
i think the q is what you want to do... also, you might get interested in other things later. listening on HF/VHF/UHF now with a cheap SDR, appropriate software, and an improv antenna will get you started about what is on the bands. For just listening you can get away with a whip antenna or random piece of wire.
there are articles and books about apartment operating
e.g. get an RTL stick SDR now
not much in the ARRL handbook about this though. apartment appears twice in the whole thing that is why Im confused about it / asking these questions 🙂
This book is out of print but you could probably get it from the library: https://www.amazon.com/Low-Profile-Amateur-Radio-Operating/dp/0872599744
websearching "ham apartment operating" will get you more. For HF, you can use mobile antennas mounted on the balcony or a "magnetic loop" (small loop), but you are not interested in HF, sounds like.
antennas are not magic. A simple J-pole or similar will be fine to start with.
ARRL Antenna book has more material than Handbook for antennas in particular. Again, maybe check the library first before purchasing
seems like the low profile one is in the digital subscription of my public state library
but only 2007 prehistoric editions
2nd edition is supposed to be highly revised
Im a bit confused about rtl-sdr
it is supposed to be an open system like arduino ? Cause I see lot of unrelated "brands" selling it
And I dont see an rtl-sdr brand
rtl-sdr is the software driver for the RTL2832 family of chips.
@short nimbus see https://www.adafruit.com/product/1497, but also see the links there.
don't need to buy from us -- lots of places to get these
I tried on my rasp 4 and I wasn't able to detect the packets
Does anyone know of a clear, complete list of the US915 LoRa single channel point to point (not LoRaWAN) transmit restrictions?
So I did get an rlt blog rtl-sdl kit. Will arrive around monday. Already tried the web version of SDRs that peoples host so getting used to the interface etc
👍 like this? https://www.amazon.com/dp/B0BMKB3L47
yep
mostly want to lisiten to ATC (legal in Canada) and checks for lifesigns on centimeter bands
also rx-only so no way I have a tx accident
only bad thing is that Ill need 25ft of coax
Listening to it is legal everywhere I think. It's not like they can prevent anyone from doing that without encrypting it, and there's no need outside of military use. Transmitting on those bands would be Very Bad™️.
Things like subcarrier audio (SCA) are related, it's not encrypted, but you're not supposed to listen to it without paying for it.
Yeah good luck enforcing that.
Im only able to transmit on 20 to 120Hz so far and 400 Thz to 750 Thz(by accidental reflection not direct transmit) so not going to have problems I think
so no worries
the rtl-sdr cannot transmit either (but Im aware everything transmit when listening at very short distance because of interference/rf leaking)
20Hz? The 180 megameter band?
human voice 😄
they investigated my rtl-sdr 6 times at the canadian customs 🤣
Maybe it will be delivered by the RCPM / Industry Canada 🤣
i thought amazon.ca might have meant it was already warehoused in CA
Hi all. Does adafruit have any boards that have both wifi and rfm69 (or lora)? I’m trying to build/find a simple radio to mqtt gateway device.
nope, but you can combine a Feather ESP-S2 or -S3 Feather and an RFMxx FeatherWing very easily.
I'm not sure how well the radios will work together, being so close
you may not want to stack them, but separate them a bit.
And just communicate between them over serial?
The FeatherWing is just a peripheral rather than a full-fledged MCU board by itself, so the ESP32 would be in direct charge of both radios.
you talk to the FeatherWings over SPI
If anyone can track down the part number for the ceramic antenna used on the Raytac nRF52840 modules (like https://www.adafruit.com/product/4078) Adafruit uses in their BLE feathers I'd be forever indebted to you. Please @ me if anyone finds it!
I have an nRF52840 Express that I've just discovered suffers from the "magic finger" bug. It has extremely poor BLE signal which suddenly gets 100x better whenever I touch the antenna with my finger.
Not sure how to test it with a scope / meter, or if I can, but I'm guessing the ceramic antenna on mine has cracked. Looks like a fairly simple part to replace, and I'm guessing it'd be cheaper than throwing out the whole feather board.
Ah, I'm thinking this may work. I'll throw it in the cart for my next Digikey order
https://www.digikey.com/en/products/detail/johanson-technology-inc/2500AT44M0400001E/1840063
we don't have a part # for the antenna because it comes with the module. I haven't been able to find out a part # for it either
Thanks
I almost wonder if Raytac makes them in-house, or if they have another manufacturer making it proprietary for them; they certainly move enough volume too justify it.
The one I found earlier looks like a footprint match and it's gain numbers are similar to the ones listed in Raytac's datasheet for the module; can't hurt to give it a go. Worst case I'll just DIY a 2.4G wire antenna and solder it on.
Afaik all of Ada's nrf52840 boards use the same Raytac module, pre-flashed with the bootloader ofc.
The individual ones I linked above don't come with bootloader flashed though
you dont have the raytac model number for the module right ?
if you did it's very likely the FCC fillings would say which antenna they use
Good idea! It is MDBT50Q-1MV2. I was looking on the datasheet.
and didn't find the antenna. I don't have time right now to look up the FCC filing, but maybe you know where to look
not 100% sure
seems there are like 4 submoidels even in the same model of raytac
and it mostly show flexible antennas and the very small one is just labeled Bluetooth ANT
while the flexible ones are molex 146153-0150 and -0300
I mean I dont see why they would make the antenna separate one in a small blue module. Its probably just a random piece of metal made by raytac
id look in the test resultts or the internal pictures
Question: The RFM69 boards are advertised as using 915MHz, but I can't find any information on frequency beyond that. According to the chip datasheet, it can do 902MHz to 928MHz. Is there a way to select the frequency in CircuitPython (or Arduino), or are the chips hardcoded to just one frequency on the Adafruit boards? (I also have the same question for the 433MHz versions.)
I'm not sure offhand how much the Arduino or CPy drivers expose, but the frequency should be selectable with chip registers, so I'd generally expect that they would support it. "915MHz" is usually just used to describe the center frequency for the whole available band.
Right, that's what I assumed, but I'm not seeing anything on Adafruit Learn or the documentation on frequency selection. Maybe I'm looking in the wrong place? I prefer to use Circuit Python, and I don't have time to add features to the driver myself right now. Does Circuit Python provide any way to access the chip registers? I assumed it doesn't, but...
Hmmm, I'm definitely a little bit confused. It looks like the CPy driver has code to set the frequency registers, but the annotations want you to pass in only "433" or "915" exactly, even though it's calculating the more generic clock config registers from that value. I also don't immediately see anything like a channel selector.
It loooooks like you should be able to directly set the .frequency_mhz field to a floating-point value of your choice after initialization and it would do the right thing, though.
However, take that with a little bit of a grain of salt, as I might be missing something with a quick glance.
Ok, that's very helpful! Maybe I'll get one and test it out a bit. I've got a handheld and an RTL-SDR I can use to listen to see if changing the frequency works correctly.
I really would like to hook one of those up to an amp to get longer range (don't worry, I'm licensed, so it's legal, as long as I follow certain protocols), but if it only works on a single frequency that's a non-starter, because interference between devices becomes a major problem. (I really want to see if I can push the local HAM club into more modern technology, and if 20 or 30 people are all trying this on the same frequency, it won't work.)
I believe the boards support a wider range, and are used at 868MHz in countries where that band is permitted.
Yeah, they do support 868MHz. I'm in the U.S., where that's not an unlicensed or HAM band, so I'm mainly interested in the 915MHz and 433MHz.
In fact, looking at the data sheet, it appears that the chip supports all of those bands, suggesting that the 915MHz version is merely coded to use that band and not limited to it by the hardware. I might be wrong, but if I understand the data sheet right, the 915MHz version should also work for 433MHz, if you just set the frequency to that.
(If anyone here knows better, feel free to correct me...)
While the chip itself supports it, the matching networks on the board are pickier, you have one design for the 433MHz band, and a different design for the 868-915MHz band.
Oh, that makes perfect sense. Thanks for the explanation!
Hello! I'm using an RP2040 feather w/ LoRA FRM9x @ 915MHz and CircuitPython. I'm trying to see if I can squeeze a bit more range out, so I wanted to bump up the tx_power from the default of 13 to the max of 23 (listed here: https://learn.adafruit.com/adafruit-rfm69hcw-and-rfm96-rfm95-rfm98-lora-packet-padio-breakouts/circuitpython-for-rfm9x-lora). However, when I set the tx_power to anything higher than 19, the feather starts to reboot sometimes when when I run send_with_ack(), sometimes coming back up and continuing and sometimes switching into safe mode with a hardware error. Any ideas?
Could be a power supply problem: to transmit more energy, the radio needs to draw more current. If the power supply can't manage that load, the voltage could sag, causing a brownout/reset.
I've tried a usb-c cable connected to my Mac and/or a 3.7V 350mAH lipo connected to the charge port
It could also be an interference issue: the energy radiated from the transmitter can be picked up by the other wiring and interfere with logic signals.
Would that be fixable by shielding the antenna from the board, or it would be from the transmitter inside the chip and so I can't do much about it?
I'm just using one of the little coil spring antennas soldered to the antenna pad on the board
Or is there a way if I can check with a multimeter if it might be power supply vs interference?
It's occasionally doing it even at the default value of 13, which seems like a problem.
It's happening more often when I have USB plugged in, vs when I'm running just off the battery, if that is useful information
It's hard to tell, not only do USB ports vary, but the USB cord itself could be acting as an antenna. If your board is one with a U.FL connector, you could try moving the antenna away from the board to see if that helps. If not, maybe try putting some metal between the radio and CPU to act as shielding.
It would be hard to see brief voltage sags on a multimeter, unfortunately
FYI - I tried this on a feather_rp2040_rfm9x and I cannot reproduce the problem. Mine is transmitting with tx_power=23 successfully via both USB and with a battery. I am using this code .
Thanks for testing! I'm leaning towards it being a power issue; possibly the USB ports that I'm using on my computer aren't supplying enough power. I switched one of the feathers to using a cell phone charger and it didn't reset immediately. Still confused at why it resets with the lipos though. Do you mind if I ask what battery and antenna you were using?
I am using a spring antenna and a 2200mAh battery.
And the 2200mAh is still 3.7V?
yes -- this one https://www.adafruit.com/product/1781
Thanks! I'll have to try some other USB ports and check my code against the sample to make sure I'm not doing anything weird.
But knowing that's not expected behavior is helpful
Good luck -- BTW -- I have had issues with the RFM9x_RP2040 when I connect it to the USB ports on my MAC. Sometimes it just hangs the MAC until I disconnect it. IT works fine on a Linux system...
I need to do more testing so I can open an issue for that behavior.
Yeah, I'm on an M2 Mac. Hasn't been hanging the machine but they disconnect and reset like crazy when I try and send packets. I can try running through a powered hub or something first to see if that helps too
I can try testing off a Windows box. My Linux machines are all Pis so the USB power output is a little limited
hmm -- mine freezes the entire MAC but recovers when I unplug the board....
I am also using powered hiubs.
That sounds like a Finder issue where it's still trying to read from the CircuitPython drive and not timing out properly when it disconnects
But I don't know why it would be disconnecting
But also good info!
Me either -- and it appears to only happen with the RP2040 board -- not any others. I just have not had time to work up a good example of the behavior. I'm not sure if it is related to the Radio or not.
If I keep getting stuck I might switch to arduino code from CircuitPython and see if that makes a difference. Also at that point I believe I can use interrupts to have each of my senders also being a repeater for any packets they receive, which will help with range as well
Acutally, I am using a Pi400 for the "linux" box now.
Oh, interesting. I do have a Pi4 I could try with. I was thinking of the Pi1B that's sitting in my desk not currently in use
Gotta go to my day job, but sounds like I have plenty more testing I can with on tonight now. Thanks!
Good luck!
Pulled the batteries, plugged one feather into a cell phone charger and the other into a known good USB-C to USB-C cable direct into USB-C on the Mac and so far no crashes @ tx_power=23
I'm now suspicious of the LiPos. Maybe the 350mAh are small enough that they are dropping voltage with the full current draw of the transmitter
Yes, the lower capacity cells have greater internal impedance.
Thanks for all the help, I'm hoping swapping to better power has solved my issues. 🤞
After some further testing, I am seeing some issues with the USB connection dropping (on bi the Mac and Pi) sometimes when I use the higher power. It causes the MAC to freeze, but the Pi just briefly disconnects and reconnects. The RFM9x does not reset. I think this is a different issue from what you have been seeing.
That sounds similar to what I was seeing actually but I may have been explaining it badly. The Pi disconnects and reconnects a whole bunch, and sometimes will reboot into safe mode, and I get no errors or useful output in the console when it happens, so it wasn't clear what the problem is.
I'm still optimistic that it's just a power issue, because in my short test after switching to dedicated USB power and disconnecting the battery, I didn't have any resets or disconnects. I'm going to try cell phone USB packs tonight for a range test and see if the Pis are more stable on those than the LiPos
I am having trouble getting a clean way to demo this. I agree that it may all be power related. I'll keep poking at it as well. Thanks!
ah - finally reproduced the "Safe mode" entry on the Pi .. progress
hmmm -- on my Mac, I had been using the "mag-tip" cables. Switching to a "normal" USB-A to USB-C cable between my powered hub and the RFM9X RP2040 seems to be working much better.
but the same "fix" does not work on the Pi...It still disconnects when I transmit at 23.
OK -- back to the drawing board. The MAC just "froze" even with the new cable. This still may all just be "power delivery" but there is something different about these RP2040 RFM boards...
Not sure where to asks this but can I plug my rtl-sdr on a powered usb hub despite all the heat it generates ? Is a usb hub internally not much heat resistant vs when the rtl-sdr is next to another usb plug on a computer? Or there are no reason to worry here?
I feel better about you being able to repro it at least, not just me doing something silly
It may be a power draw issue as well as a heat issue. You can always stick it in a plug away from other things for better airflow.
Hey guys I want to transmit 3 variables via radio using circuit python and a rfm69 radio
Can someone give me or mock up some code for me in not the most experienced and have like a day and a half to do this
Good resources here https://learn.adafruit.com/search?q=rfm69 and examples here https://github.com/adafruit/Adafruit_CircuitPython_RFM69/tree/main/examples
@spice sluice the protocol sends bytes, so depending what type your variables are, you may need to convert or encode them as bytes
Ok thanks I’ll look at the links you have sent.
Just some more information... I hooked up a PPK2 power profiler to see what the current draw was for tx_power = 23 -- it is ~150mA (~100mA at tx_power=13 - default) - Nothing surprising there. I also hooked up a scope to see if I could see any impact on the bus voltage -- I did not. However, transmitting at tx_power = 23 does impact the Mac severely. Now it is disconnecting the CIRCUITPY drive ( and resetting the board) with every transmission. If I power it from a USB "wall supply (2A), then it works fine.I am really puzzled by this. Next I will move back to some other RFM9x boards to see if this is only the case for the RP2040RFM board as I suspect it is....
The issue does not occur when running the same code on a feather m0 rfm9x
RFM9x RP2040 USB interference at high power
@untold glacier @normal drift The general rule of thumb I've heard on LiPos (and lithium ion in general) is that the batteries don't handle drawing more power than their rating number very well. So if the battery is rated for 350mAh, you'll probably get an unacceptable voltage drop if you are drawing more than 350mA. The Macs are probably providing 500mA, so if it's not working well on the Mac, it's probably not going to work well with a 350mAh battery either. (Again, this is just the rule of thumb that I've heard. It's probably not super precise, and maybe more recent LiPo technology can handle higher draw better. The symptoms do sound like the problem is a big voltage drop though.)
Any idea why it would only happen on the RP2040 feather and not the M0?
The RP2040 probably draws more power than the M0.
On a side note: If you are only transmitting intermittently, putting a large capacitor across the power bus could solve the problem. This could work as long as the capacitor holds enough power to provide the extra current during transmits and has enough time to recharge fully between transmits.
import board
import busio
import digitalio
import adafruit_rfm69
import adafruit_bmp280
import struct
LED.value = True
# Print out the raw bytes of the packet:
print("Received (raw bytes): {0}".format(packet))
# And decode to ASCII text and print it too. Note that you always
# receive raw bytes and need to convert to a text format like ASCII
# if you intend to do string processing on your data. Make sure the
# sending side is sending ASCII data before you try to decode!
env_packed = float(packet, "ascii")
print("Received (ASCII): {0}".format(packet_text))
Hey i am working on some code to recieve and save data to a .txt file if im honest i have got here and dont know where to0 go from this point.
you'll probably first want to unpack the received raw bytes into the 3 float variables, then make a string (or CSV line, or something), print it for debug for now at least, and write (append) it to the .txt file
where is the text file - on the CircuitPython device flash or SD Card or other?
(writing to the CircuitPython device flash requires some special setup: https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage)
Well i was hoping to have it onn a pi which is connected to a pc. The written data is then also printed to a console or something
Is it possible to apped 3 files at teh same time
should be much easier on a Pi to do the file writing. yes you can write to multiple files (sequentially, not quite simultaneously)
Ok. Well considering we are recieiving every 30 seconds we should have enough time.
f.write( 'dict = ' + repr(dict) + '\n' ) i understand i need to use thise line. But itr isnt expolained that well. Do i replace it to be this f.write( 'alt_unpacked'\n' )?
I'm guessing you want human-readable text files, and I suspect alt_unpacked is a float, so you'll want to turn that into a string to write it to the file
Would it be like this?
or f.write((str) 'alt_unpacked'\n' )
you can test it on your laptop with regular Python, to get it exactly how you want it 😉
I think you want to open for append, not write?
also looks like you're only unpacking 2 variables, but I think there are 3?
there are a few ways to put variables into a string form https://realpython.com/python-string-formatting/
(I prefer method 3, a lot of use is still method 2)
Ok, I dont understand where i convert it though.
for example:```py
foo = 3.14
f"the value of foo = {foo}"
'the value of foo = 3.14'or, in code.py:
print(f"the value of foo = {foo}")
the value of foo = 3.14
similar in a file write / append
(write the string form of the variable(s), along with any desired punctuation or other string info)
foo is a variable name
f.write("some line of text\n")
# or
foo = 3.14
f.write(f"the value of foo = {foo}\n")
in an f-string, f"some string {some_variable}", the variable name goes inside of curly braces
some string being the alt_unpacked?
the string form of the variable alt_unpacked
strings can be any text, variables need to be converted / formatted using an f-string (or one of the other methods from that link)
can you pull up a Python REPL on your laptop? makes it easy to quickly test things iteratively
im on my pc now. Im just looking at the code you sent
import board
import busio
import digitalio
import adafruit_rfm69
import adafruit_bmp280
import struct
rfm69.receive()
temp_unpacked, press_unpacked, alt_unpacked = struct.unpack('ff', env_packed)
print(str)temp_unpacked, press_unpacked, alt_unpacked)
f.write(f"temp_unpacked = {foo}\n")
f = open( 'alt.py', 'w' )
f.write( 'dict = ' + repr(dict) + '\n' )
Like this
Im very confused
Maybe something like ```python
temp_unpacked, press_unpacked, alt_unpacked = struct.unpack('fff', env_packed)
print(f'temp_unpacked = {temp_unpacked}')
print(f'press_unpacked = {press_unpacked}')
print(f'alt_unpacked = {alt_unpacked}')
with open('alt.py', 'w') as f:
f.write(f'dict = {repr(temp_unpacked)}\n')
'fff'
Good catch, edited
So, theoretically is this working?
import board
import busio
import digitalio
import adafruit_rfm69
import adafruit_bmp280
import struct
rfm69.receive()
temp_unpacked, press_unpacked, alt_unpacked = struct.unpack('fff', env_packed)
print(f'temp_unpacked = {temp_unpacked}')
print(f'press_unpacked = {press_unpacked}')
print(f'alt_unpacked = {alt_unpacked}')
with open('alt.py', 'w') as f:
f.write(f'dict = {repr(alt_unpacked)}\n')
with open('temp.py', 'w') as f:
f.write(f'dict = {repr(temp_unpacked)}\n')
with open('press.py', 'w') as f:
f.write(f'dict = {repr(press_unpacked)}\n')
It's probably quicker to try it than ask me. I'm guessing you need to do all the rfm69 setup first
like is that recieving and saving the data
i dont have any of the stuff on me
it will need to be in a while true statment as well
well, env_packed isn't declared anywhere... presumably it comes from rfm69.receive()?
like env_packed = rfm69.receive()? (assuming that the function returns that variable with all of the packed bytes)
import board
import busio
import digitalio
import adafruit_rfm69
import adafruit_bmp280
import struct
# Define radio parameters.
RADIO_FREQ_MHZ = 915.0 # Frequency of the radio in Mhz. Must match your
# module! Can be a value like 915.0, 433.0, etc.
# Definepinsconnectedtothechipuse these ifwiringupthebreakoutaccordingtotheguide
CS = digitalio.DigitalInOut(board.D5)
RESET = digitalio.DigitalInOut(board.D6)
# Or uncomment and instead use these if using a Feather M0 RFM69 board
# and the appropriate CircuitPython build:
# CS = digitalio.DigitalInOut(board.RFM69_CS)
# RESET = digitalio.DigitalInOut(board.RFM69_RST)
# Define the onboard LED
LED = digitalio.DigitalInOut(board.D13)
LED.direction = digitalio.Direction.OUTPUT
# Initialize SPI bus.
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
# Initialze RFM radio
rfm69 = adafruit_rfm69.RFM69(spi, CS, RESET, RADIO_FREQ_MHZ)
env_packed = rfm69.receive()
temp_unpacked, press_unpacked, alt_unpacked = struct.unpack('fff', env_packed)
print(f'temp_unpacked = {temp_unpacked}')
print(f'press_unpacked = {press_unpacked}')
print(f'alt_unpacked = {alt_unpacked}')
with open('alt.py', 'w') as f:
f.write(f'dict = {repr(alt_unpacked)}\n')
with open('temp.py', 'w') as f:
f.write(f'dict = {repr(temp_unpacked)}\n')
with open('press.py', 'w') as f:
f.write(f'dict = {repr(press_unpacked)}\n')
I suspect you want to open the files for append, so you get new lines every 30 seconds?
with open('alt.py', 'a') as f:
hard (for me) to say just by looking at code
"the proof is in the pudding", as they say
probably just help-with-circuitpython
i need to now set it up to communicate with sonda hub for our tracking
the code above is on a Raspberry Pi? And it has an RFM69 bonnet or something? And it's set up with Blinka to use CircuitPython libraries?
blinka?
I installed libraries once by sticking it all in the same file
i was going to do this that way?
ye it is on a pi
not a Pico, this is a Raspberry Pi like a Zero W or Raspberry Pi 4 or something?
Pico is completely different than a Raspberry Pi, and the implementation will be different... a Pico may not have all of the things you need in your ground station??
(just recalling something vague from yesterday)
i was going to use a pico for the balloon
right
OK, actual Raspberry Pi... it can write to files on the SD card
BUT...
CircuitPython doesn't run natively on a Raspberry Pi (well, technically it does, but it's very alpha and doesn't support all the things, so ignore that)
so we wrote that in circuit python when it should of been 'normal' python
well, normal Python may or may not have support for the hardware libraries you need to use (I'm not the best one to ask that)
to use CircuitPython libraries on a Raspberry Pi, typically install Blinka https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
ok. Well i can deal witht hat bit tommorow when i have the pi
got to hop off for a bit
Hello! Since I'm still having issues with the RP204-based LoRA boards resetting (even when connected to USB power now occasionally), I'm going to switch to M0-based LoRA feathers. Next thing I'm looking at is antennas. I am currently using the small spring antenna, but I probably have room on this project for an up-to 8" antenna if necessary. Not knowing too much about RF propagation, would a slightly larger antenna even help? I was thinking about trying something like this: https://www.adafruit.com/product/3340 but it seems to be discontinued. Is that because it has a very similar/same performance as the spring antenna?
I'm trying to get a bit more range through a bunch of steel and concrete indoors. Running at 915mhz, and my data is approximately 10 byte packets once every few seconds.
I'm also going to try playing with the bandwidth, spread, and coding settings, but my current testing with that is stalled by the feather resets, so I'll wait till the new ones come in to ask questions about that.
I wonder if the resetting issue is because the LoRa module creates a current spike that drops the voltage and temporarily browns out the microcontroller. A solution would be to add some more decoupling caps to the board near the LoRa module
More info/history here: https://github.com/adafruit/circuitpython/issues/8176
The initial current spike could be so short though that the ppk2 doesn't see it because all it does is discharge some of the decoupling and bulk caps on the board which causes a voltage drop that browns out or destabilizes the RP2040.
Yes, the spring antenna is not very efficient at all, a simple wire antenna will get a lot more signal out
Ordered some 1/2 wave whip and ufl to sma connectors as well. I have 26AWG solid core sitting around, I assume that should be good to test with if I cut it to the correct length?
Yes, a simple wire antenna of the proper length works quite well
You will find the M0 LoRa board to be very difficult to use with CIrcuitPython, especially if you are using any other sensor or display. Note that the rfm9x library is already “built in” to the .uf2 file for that board. Even so , there is very little flash or RAM. I recommend using Arduino/RadioHead with it.
No other sensors or displays aside from an RFID/NFC reader via UART. I can switch to arduino if needed, just started with CircuitPython because it was easy. I have antennas being shipped as well; if that solves the problem with the RP2040 board I can use those instead. Whichever ends up being more stable.
(Haii everyone. So I know nothing about circuitry so please understanding of that please!)
Is there any way to increase the range of the Adafruit Stereo FM Transmitter? I would Like to be able to 60 feet compared to the stock 30ft desistance?
Probably not legally.
so am I legaly limited to 30 ft? /Gen
You're legally limited to a certain transmission power and antenna gain.
do you know where I could find these transmision laws? /gen
Depends on where you live.
ok thx!
(Haii everyone. So please know that I nothing about circuitry so please be understanding and patient please!)
So I want to make a little radio station for a geocache and want to know what I am going to need? the radio will be inside a house (with permission) and will transmit the needed info out to the street front to complete the cache.
Ideally I would like to just plug this whole set up into a house wall outlet.
with my very very rough understanding I think I need a bread board to connect everything. But what are other thing I should or shouldn't pick up for this project?
(tools is not an issue my school has the tools necessary)
also could I use a regular old MP3 Player to play my audio to transmit?
you dont need the player unless you want to listen to it as it transmit
Also the receiver wont get an mp3 file but a FM modulated signal
so formats like mp3 dont matter here either. And you'll need an MCU plugged to the headphone jack of the breakout. Think of it as if the fm transmitter is the "player"
also the antenna has to be legal in your juridction for an unlicense FM transmission
Then what do I need to play audio?
What is an MCU
An MP3 player is a fine source, as is any other audio source you may have available. "MCU" in this context refers not to the Marvel Cinematic Universe, but Microcontroller
What microcontroller should be used for this project?
It doesn't sound very demanding, I'm guessing it just has to tell the transmitter what to do, then it's basically idle? Pretty much anything would work here.
any specific module recommendations?
I would recommend a breadboard for testing. Right now, I'm doing something with extremely simple wiring so I just use jumper wires directly without breadboard. But that gets extremely annoying as soon as you have to connect 2 wires to one pin, use pcb-less components like LEDs, etc.
Then, for the final build you could again wire it directly. Or to make it neater and easier by using some kind of prototype PCB. https://www.adafruit.com/category/466 (Various sizes, and packs of multiple available) This is probably the most expensive version, but it's very convenient because it's wired exactly like a breadboard so you can just 1 to 1 move your tested circuit from breadboard to soldering.
Other common kinds of protoype PCBs have no connections at all between the pins, or have all pins in each row connected.
Adafruit Industries, Unique & fun DIY electronics and kits : Perma-Protos - Tools Gift Certificates Arduino Cables Sensors LEDs Books Breakout Boards Power EL Wire/Tape/Panel Components & Parts LCDs & Displays Wearables Prototyping Raspberry Pi Wireless Young Engineers 3D printing NeoPixels Kits & Projects Robotics & CNC Accessories Cosplay/Cost...
If you do featherwing + feather then your wiring is probably very simple so you might not need a breadboard or prototype PCB but some stacking headers might be useful 🤔
The system requirements of both the FM radio and the music maker wing seem extremely low. The music maker only needs SPI and does all the mp3 decoding for you. But still I would check to get a microcontroller that is supported by their libraries. The music-maker seems to only have an arduino library and no circuitpython support
@fallen parcel we tried a CircuitPython library for VS1053 but it couldn't keep up: see https://github.com/adafruit/Adafruit_CircuitPython_VS1053
neat! 😄
But it isn't in the guide https://learn.adafruit.com/adafruit-music-maker-featherwing/installing-software 😝
But we have MP3 decoding on RP2040 and other chips: https://learn.adafruit.com/search?q=mp3
it's not in the guide because it didn't work 🙂
lmao
RP2040 is fast enough for software MP3 decoding? How does circuitpython do that? Is the mp3 decoder in python or c++? (Only if you know this. Otherwise I will just search myself. Could be interesting for my project as well)
there's C code that does the actual decoding. The bit rate has to be low enough. The guide describes it: https://learn.adafruit.com/mp3-playback-rp2040
great to know. Thanks!
this makes me wonder how QOA (https://phoboslab.org/log/2023/02/qoa-time-domain-audio-compression) would perform on a microcontroller
Probably a lot of floating point, so something like an AVR probably couldn't manage it, but one of the fast i.mx chips might be able to.
it actually has no floating point and not even any division except for one in the encoder
the point is it's simple
maybe you could add it to https://github.com/pschatzmann/arduino-audio-tools 😄
(or suggest it to him. That library already supports dozens of codecs)
nobody mention checking legal stuff for transmitting ?
in canada you are restricted to like 1/25 wavelenght for unlicensed am/fm so the provided one is too long
why didnt it work?
Provided what? Antenna?
yeah there is a wire antenna that comes with the kit
I find it bizarre that there's a limitation on antenna length instead of transmit power or (more appropriately) radiated power. Limiting the antenna length gives too many opportunities to game the system.
There are lots of ways to get serious efficiency out of shortened antennæ, there are entire industries built on doing exactly that.
there's many restrictions one of which is antenna length
like for AM it's 3 meter including the power cord and the ground mass
so 1/100 wavelength depending on the frequency...
along with the 100mw output limit etc etc etc
I find it kinda funny though
like even if you are licensed the limiting factor clearly isnt the electronics
but the 900 feet antenna you need and the crane you need to rent to put it up and having enough land
costs about 800$/h + a 5k$ deposit + 1k$ a day for the driver/supervisor in my area for a crane
What "needs" a 900 foot antenna?
AM ?
like at 500 khz for transmitting if you are licensed/a radio as per 1/2 wavelength to transmit ?
There is a description in the README and the code of the problems encountered. It was a question of speed
thx!!
Most people don't use half wave antennæ at 500kHz
Most people, even licensed people, don't transmit at all on the longer bands. I have my Amateur Extra license, but I don't even bother with the longer wavelengths, because even a quarter or eighth wavelength antennas are way too long. Sure, you can use shorter antennas, but you'll need significantly more power and get much higher losses that way. At the really long wavelengths, the transmitters required to get good results from shorter antennas are prohibitively expensive, and you still need a really long antenna, even if you can get away with a smaller fraction of a wavelength. 2,200 meters, the longest HAM wavelength, still requires a 72 foot antenna at 1/100th, and it's going to perform very poorly even with the best transmitter on the market. AM radio stations transmit up to 50kW, and those are operating around 550 meters, where a quarter wave antenna is less than 500 feet. Amateurs can't do 50kW to get a reasonable broadcast range, and they need much longer antennas to get the same performance at longer wavelengths on top of that.
I do know that most people don't use half wavelength antennas at 500kHz. This is because most people can't afford to broadcast on 500kHz to begin with, and even if they could afford the equipment, they wouldn't be able to afford the antenna on top of that. (People who have the wealth to afford all of this typically live under HOAs that forbid tall antennas and the towers required to hold them.) Most people don't bother. I would love to transmit in 630 meter band (472kHz, the closest HAM band to 500kHz), but I just don't, because I can't afford the antenna and required infrastructure to put up even the ~500 foot quarter wave antenna required to get good range with affordable HAM equipment. I would use a halfwave antenna at 500kHz if I could. The reason people don't is cost, not because you don't need it to function well.
So, electronics is part of the limit, but the cost of putting up an antenna that can handle the lower bands (and get good results) can actually be significantly more than the electronics.
I could probably set up a 500kHz loop that doesn't take too much room. That might be an interesting experiment.
Hmm, maybe. Loops aren't as good as other types of antenna, but they are generally better than just a shorter straight antenna, so maybe. I agree, that might be an interesting experiment!
hi guys ,recently im making a tiny esp32 dev board which required an antenna, do you have any recommendation of tiny smd footprint antenna for wifi. I used johanson antenna 2450AT18D0100E, but i didn't work for me
I've had good experiences with a Taiyo Yuden AH316M245001-T chip antenna for WiFi.
1/2 wave whip antennas for the RP2040 LoRa testing came in. Only been testing for a few minutes on USB power connected to my Mac, but no resets yet 🤞
I have some questions about LoRa settings though. I'm using this website https://unsigned.io/understanding-lora-parameters/ to try and figure out the best settings for my environment, but I'm starting with tests at my desk with the modules about 5 feet from each other.
tx_power is 23, coding_rate and spreading_factor are default, and I'm experimenting with changing the signal_bandwidth. If I set signal bandwidth to 62500, everything works pretty well. I'm using send_with_ack and receive(with_ack=True). Occasionally the sender won't see the ack back from the receiver, which seems a little odd at this close distance but I can deal with it for now.
The first issue I'm seeing is that as soon as I bump down the signal_bandwith one more step to 41700, the two RP2040s no longer see each other. I'm sending about 100 bit packets and flashing the LED when they are sent and received, and get nothing once I jump down to 41700 on signal_bandwidth. Is that expected?
I guess you want bandwidth to be high. Not exactly sure why you're having that problem below 41700 but it probably isn't beneficial to lower bandwidth unless you're on a crowded channel
If I'm wrong please correct me
You're correct. Wider bandwidth means more data per unit time can be transmitted. If the bandwidth is too low for the transmit speed, the signal will be garbled. It's possible that's what is happening here. I don't know enough about LoRa to actually do the math though. It's also possible that the chip itself isn't terribly precise, in which case some bandwidth is wasted on that, and the speed/bandwidth issues get even bigger.
I can't say exactly what isn't working here, but there's some background information that might help.
I'm not expecting a crowded channel, but I'm not sending many bytes and I'm looking for more range, which is why I was tweaking some of the settings. My range test today with the new antennas went pretty well though, so I might be ok with the current settings.
You've got the right idea, you can trade bandwidth (speed) for range. However, I too am unclear on how the various LoRa parameters interact.
With my current settings, I got about half a mile through some buildings and warehouses, which is good enough for the moment. The next thing I need to figure out it what device I will need on the receiver end to receive data from a number of RP2040 LoRa modules. I'll likely have between 9 and 14 RP2040s, each with an RFID read that can get tagged up to once every 30 seconds. The goal is to record all the RFID tags on a Pi, NUC, or other PC somewhere in range. Worst case I guess I could use a match RP2040 for each receiver and a USB hub to connect them all, but that doesn't seem like the most efficient option. I'm trying to research LoRa gateways, but most of what I'm finding is LoRaWAN-based, which isn't quite what I'm looking for. Anyone have suggestions on hardware I can use, or what search term I'm missing to try and find something that can receive packets from multiple LoRa senders at once?
I’m not sure I understand the problem. Any LoRa board can receive from multiple transmitters. The RadioHead (Arduino) and Circuitpython libraries use the same packet header that supports addressing of up to 255 “nodes”. You should be able to use an RFM9x module with a raspberry Pi as the receiver. THe “bonnet” is nice for use with a Pi https://www.adafruit.com/product/4074. Or am I misunderstanding your needs?
You would definitely want to use the “reliable datagram” mode to avoid “collisions”
I guess the thing I'm worried about is timing/collisions. If all my senders happen to try to send a packet at the same time, and I can only receive 1 packet at a time, I was thinking I might miss some packets. And I cant block too long on each sender since they are triggered by user interactions and not a sensor check-in. But I guess I should just try it first and see how it goes before I try to get too complicated
How long are your messages? There's always a chance of missing or overflowing the FIFO even with only one sender. Reliable datagram mode lets you add some robustness in case no ACK is received.
The "reliable datagram" mode handles ACK packets and retries so I would expect it to work for you.
I'm not sure multiple receivers would be all that big a help since they all still actually receive the packets from all nodes. They just decide in software if they want to accept it.
reliable datagram retries are manually though?
You set the number of retries and the software does it
you code does not have to do the retry.
and there is some random delay to retries to avoid repeated collisions.
I see, defaults to 5 retries
After that -- you get a failure response so you can manually restart if necessary
a fast, interrupt-capable environment (e.g., Arduino) would be less likely to get misses or fifo overruns?
Yes -- Arduino is probably more robust. And the Pi (with Blinka) is probably the least.
I have had issue between Pi and Arduino -- Arduino ACKs too fast.
I think tha latest RadioHead library now ahas a way to tweak it as well. I have not tried it. For CP, without interrupts I just don't think it can reliably handle the Ardunio response, especially on a Pi.
If I recall correctly, there was some issue with the way the Pi handle SPI transactions taht was slowing it down markedly. I'll look for some notes on it.
sounds like we need an async version of the CP lib, so the IRQ pin can be monitored, with keypad or the like
I'll take a look at reliable datagram. I'm currently using send_with_ack in CP, not sure if that's the same thing or not
is the node addressing handled in the hardware module, or in the library?
Yes, that is "reliable datagram" if used with receive(with_ack=True)
(just wondering about the efficiency of an m:n config)
In the library.
About 10 bytes, assuming I'm calculating it correctly.
so a 10-byte message about every 2 seconds (14 nodes, 30 secodns cycle) ...but highly variable timing so lumpy distribution?
Yup
I can use an arduino as the receiver, just want to periodically (once a minute maybe) dump the data back to a PC device, either over USB or via a REST API on wifi or whatever makes the most sense
As I noted, You may run into issues getting CP and Arduino to play together... I'm looking for the recent change to RAdioHead that mah help.
Worst case I can switch to Arduino for everything, just started in CP because it's so easy (as a python dev)
I hope you can stick with CP
Also @normal drift just for reference I haven't had a single reset on the RP2040 now that I switched to the external antennas as long as I keep the antenna a small distance from the board, even using the 350mAh lipos. It seems to have been RF interference as the issue. I am able to get it to disconnect the USB mass storage on the Mac if I lay the antenna on top of the board
So progress on that end!
I have had the same results.
I have 2 rp2040s and 2 M0s here that I can use for testing, so maybe I'll set up 3 of them as senders on a faster interval for testing with the 4th as the receiver and see how it goes
Although I only bought 2 antennas 😅
I'll just do a wire antenna for the other two
FYI -- This was the RadioHead issue I was referring to https://groups.google.com/g/radiohead-arduino/c/f94357_s6Qg/m/O3nflLrpAwAJ?utm_medium=email&utm_source=footer
see Line 1924
I need to experiment with this -- updating my "todo" list, Unfortunately, you have to make this change to the RadioHead.h file in the Arduino library not just to a single sketch....
Just tested the mod to RadioHead.h and it does make a big difference when using a Pi ZeroW. Adding the 10ms ACK delay on the RadioHead side allows the Pi Zero to receive the ACKs -- Without it, they often fail. On a Pi400, the delay is not needed.....
This may prove to be a huge improvement for Pi <--> CP RFM communication!
RFM?
ah
yes, sorry for being cryptic. i was referring toi rfm9x and rfm69.
that's slick
Any got ideas for the kind of radio i would need to be able to support 10-20 character text messages…, through a cruise ship
I'm thinking a LoRa module might be the way to go, cruise ships are large and contain a lot of metal, so you'd need something with a lot of link headroom. Fortunately, LoRa lets you trade bandwidth for range, those short messages don't need much bandwidth, so you can optimize for range.
Hi all, I am trying to get a pair of RP2040 RFM featherwings to act as a transmitter reciever pair as per this tutorial (https://learn.adafruit.com/feather-rp2040-rfm95/using-the-rfm-9x-radio). When I upload Feather9x_TX.ino or Feather9x_RX.ino RadioHead examples they both get stuck at the "Waiting for packet to complete..." portion and will never finish executing. Does anyone know what could be causing this issue, or have a better tutorial they could point me to?
Thanks
Are your RFM FeatherWings the RFM95 version or the RFM69 version? Do you have antennæ connected?
RFM95 with 3 inch stranded wire antennae
Hi all, I'm playing around with the rfm69 and rfm9x bonnets for Raspberry Pi. The rfm9x seems to work fine when I work rfm9x_simpletest.py but when I run rfm69_simpletest.py I run into a few issues. I get the output below. Let me know if this would be better to post under a different channel.
Temperature: 158.0C
Frequency: 32.12548828125mhz
Bit rate: 15.56420233463035kbit/s
Frequency deviation: 125488.28125hz
Traceback (most recent call last):
File "rfm69_simpletest.py", line 52, in <module>
rfm69.send(bytes("Gateway says: Hello world!\r\n", "utf-8"))
File "/usr/local/lib/python3.7/dist-packages/adafruit_rfm69.py", line 778, in send
self.idle() # Stop receiving to clear FIFO and keep it clear.
File "/usr/local/lib/python3.7/dist-packages/adafruit_rfm69.py", line 461, in idle
self.operation_mode = STANDBY_MODE
File "/usr/local/lib/python3.7/dist-packages/adafruit_rfm69.py", line 534, in operation_mode
raise TimeoutError("Operation Mode failed to set.")
TimeoutError: Operation Mode failed to set.
The rfm69 bonnet "should" work -- it does for me -- Can you post the code you are running? - Clearly the values being reported for temperature, freq, bit rate etc are garbage in your example. I took the example rfm69_simpletest.py fro the library-- set the CS to board.CE1 , RESET to board.D25 and commented out any referenced to the LED.
Does adafruit carry any simple 433.92 MHz receivers that I can simply get an OOK signal out of? The RFM69HCW 433 MHz Transceiver Radio Module appears to be the simplest but sounds like it's designed to only work with a paired transmitter with a higher level message format.
I don't think so. There are some 315MHz receivers that could do that. However, it's not hard to find simple 433MHz receivers, here's one possibility: https://theelectronicgoldmine.com/products/g22483
Low cost 433mH ASK/00K receiver is perfect for remote keyless entry (RKE) circuits, remote lighting controls, wireless alarms, long range RFID, asset tracking and on-site paging. The receiver module requires no external RF components. It is very sensitive and stable due to its super-regenerative design. Operates on 5VD
spent a solid 40 minutes debugging an issue with the Adafruit BLE Sniffer on MacOS, having even remembered that I had to change the interface.split('-') to be interface.rsplit('-').
I remembered wrong. It needs to be changed to interface.rsplit('-',1)
Guess that's a sign to go to bed!
good day all..
I would like to know how to disconnect from a wifi connection and switch to monitor mode (and being able to set the channel). Because if I connect to an AP, which is on channel 3 and I change my wifi into monitor mode on channel 5, when I retrieve a packet in monitor mode the channel from the packet is still 3 (from the AP) and not channel 5 from the monitor mode.
import wifi
import random
import time
import ipaddress
ssid='YOURSSIDHERE'
passwd='YOURPASSWORDHERE
def show_monitor_example(n=1):
for i in range(0,n):
channel_num = random.randrange(1, 14)
print(f"{'-'*25}\nMonitor starting on channel {channel_num}...")
m = wifi.Monitor(channel=channel_num)
time.sleep(1)
p = m.packet()
if p != {}:
packet_ch = p[wifi.Packet.CH]
print(f"Packet received on channel {packet_ch}")
m.deinit()
return
def show_ap_example(n=1):
for i in range(0,n):
print("Connecting to ssid...")
wifi.radio.connect(ssid, passwd)
if wifi.radio.connected:
print(f"Connected to wifi on channel {wifi.radio.ap_info.channel} with ip {wifi.radio.ipv4_address}")
print("Pinging 8.8.8.8")
ping_time = wifi.radio.ping(ipaddress.ip_address('8.8.8.8'))
print(f"Pingtime: {ping_time}")
show_monitor_example(3)
show_ap_example()
show_monitor_example(3)
the example above shows the issue with the 2nd show_monitor_example(3) call
I assume I have to disconnect my wifi.radio.connect() - but I have no idea how to do that. Any help is appreciated.
@buoyant rover yes, a connection to an access point fixes the channel. here's an (espnow) example where I deinit wifi and monitor to go back and forth: https://gist.github.com/anecdata/f46a1d07add5fc60cfbcf42dc7be6528?permalink_comment_id=4520301#gistcomment-4520301
connect to wifi on whatever channel the AP is on, then deinit wifi and monitor a random wifi channel, then deinit monitor, rinse, repeat
be prepared to: catch exceptions, use a watchdog timer, and have a safemode.py file to recover from hardfaults
tl;dr: wifi.radio.enabled = False & monitor.deinit()
(monitor also doesn't behave very well on top of normal wifi station-to-access-point traffic, so best to not have them both running, even on the same channel, if at all possible)
@umbral oxide thanks for the extensive explanation, tl;dr and link to the gist. I will check it out later this weekend and see if I can make it work. I did some quick trial and error yesterday as well and I think by putting a stop and start station in between also resets the channel and allows the monitor to operate on another random channel.
I only did some quick observations on this, not extensive testing, but will do so alongside applying your examples.
show_monitor_example(3)
show_ap_example()
wifi.radio.stop_station()
time.sleep(2)
wifi.radio.start_station()
show_monitor_example(3)
@buoyant rover wifi.radio.stop_station() & wifi.radio.enabled = False will free up the channel. Those two calls are different under the hood (on espressif port boards), and there are other reasons to use one or the other (or both), but for your use case, either will work.
In the context of HF ham radio, would a dipole antenna that has one end pretty close (<5 feet) to the ground cause excessive noise? The antenna is parallel to the ground, but there's some extra that dangles down.
Not noise in particular, but it will change the pattern a little
My radio doesn't have a grounding wire, could that be it?
I really have no idea at this point. What are some common causes?
What sort of noise? Hiss comes from different sources than crackle, which are different sources than hum or buzz.
It's a hissing noise. It's pretty much impossible to discern words from it, but I can tell if someone's speaking. CW is noisy, too.
By CW being noisy - I mean that I can hear the dits and dahs and would be able to understand it if I knew morse code, but I've tried 3 different programs to decode it and they all output garbage.
That could be atmospheric or static noise, or noise created in the radio itself. Does the noise change if you disconnect the antenna?
I'll try
The noise is much worse with the antenna connected. It's also connected through a tuner, so I'm going to try connecting the antenna directly to the radio.
The noise is back with the antenna connected directly to the radio.
So it's being picked up by the antenna, that's useful info
plausibly background noise
Would this be the proper channel to discuss bluetooth?
good place to start ...or if it's more of a code question, there are channels for Arduino and CircuitPython
Well it'd be using the BLE Sniffer and decoding a Bluetooth protocol.
ask away, this is as good a place as any
Don't have a question at the moment, the sniffer is still in the mail... just wanted to find the right place for questions when I can get started.
The nRF Sniffer documentation linked in the Adafruit Learn article is very, very good. One of the key things I don’t recall seeing in the Learn article was how to sniff the traffic of a device. By default you’ll only see data on one of the three advertising channels.
And that was another thing that wasn’t clear: you will only be able to sniff one of 40 channels at a time. There are only 3 you really need to sniff, but the connections can happen on any of the three. So you have a 33% chance of sniffing what you want! You can try again until the connection happens on the channel your sniffer is currently on (it hops between all 3 advertising channels)….or you can buy two other sniffers! Makediary has $12 USD dongles that can sniff BLE as well. With 3 sniffers you can configure each to listen on a specific channel and not hop. Then you can capture connections much better!
Thanks @leaden sparrow I'll keep that in mind. Guess I'll be doing a lot of turning on/off'ing 🙂
Sure thing! This page will be super useful to you: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_sniffer_ble%2FUG%2Fsniffer_ble%2Fintro.html
Well failing right out of the gate, I don't see btle in the list.
Something tells me this is only going to work with Windows
Nah, I got it working in Mac
In the Adafruit documentation is the solution.
You need to change a line from something likeinterfaces.split(‘-‘) to be something like interfaces.rsplit(‘-‘, 1)
This is what I'm referencing: https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-sniffer/working-with-wireshark
Hmm Apples PacketLogger gets bluetooth packets on the mac... wonder if I can use it with the sniffer?
Yeah I'm guessing Wireshark doesn't have access to bluetooth on the mac since I don't show any bluetooth devices when I select WIRELESS | BLUETOOTH DEVICES from the menu
I know. I just went down the same journey you’re about to take lol.
Big orange warning block at the bottom here
Unfortunately, the documentation for the sniffer is all over the place
Weird. It links to this forum post: https://forums.adafruit.com/viewtopic.php?t=202787
I see it, it says "The nRF Sniffer plug was installed and the device showed up in Wireshark, " ... but in my case I don't see the sniffer plug showing up at all (it's flashing blue so it's capturing stuff). Maybe a security feature in Sonoma... or maybe I have to go into security and allow access.. not sure.
I may be able to just use Apple's PacketLogger if I can figure it out.
Either way I'm out of time for the night. Thanks for the responses! I'll have to carry the fight on tomorrow.
I may be able to hop on a voice channel tomorrow
I've used the nRF sniffer with Wireshark under Sonoma with no problem
That is reassuring! When you installed WireShark and went to the bluetooth devices list, did you see it populated with anything? Mine looks like this. I did go into privacy and settings and set Wireshark as allowed for bluetooth.
Hmm so I didn't install the py3 stuff... doing that now.
Ok I have the device showing up now and enabled the toolbar!
Ok have to stop now. Next step is to figure out how to actually capture things using it.
Wahoo, got it capturing packets. Thanks @leaden sparrow that fix for the interface file was needed.... I wish Adafruit would update it's documentation to include that!
Anyone know what the difference between CMD and DAT does on the sniffer? I suspect given the name one only sends CMDS and the other DAT but it'd be nice if there was official docs on what that is for somewhere.
I haven't been able to figure that out, or why the yellow LED turns on now and then. But I think CMD is to program the sniffer, and DAT is to run it
you can also scour the documentation (do you see a theme emerging here 🙃) for the non-sniffer version adafruit puts out.
I was wondering about the orange LED too! 😄
Maybe we can get ChatGPT to scour the docs for us and tell us 😉
Hmm I do notice the orange led turns on when wireshark is capturing
I do think there's a bug in the adafruit firmware where sometimes during wireshark it will crash and stop reporting data. I wish nRF made the firmware open source!
Good to know, thank you! I'll keep an eye out for it.
I'm wanting to decipher the protocol used between an app and a toy so I can try to create a javascript app that can communicate with the toy. Hope the JS ecosystem is good to do that with the web bluetooth api, though it looks like Chrome and Edge are the only ones currently support it.?
That was something Google hamfisted their way in, yeah.
Ideally I could just create a React App, throw in some packages, and be off to the races 🙂
The OS isn't aware of the nRF sniffer as a Bluetooth device so you don't have to worry about permitted Bluetooth access. But looks like you made progress, congrats!
@dusky path make sure to check out the Common Sniffing Actions link I sent you. You're at teh stage where that's useful. To actually sniff the traffic between devices, you'll need to:
- Select the specific device id from teh drop down toolbar
- Keep on connecting until your sniffer is on the same channel as the peripheral's Advertisements
Once those are both true you should start to see the device's talking.
Also, make sure to try and use the nRF Connect mobile app to interact with the device
Got it! I'll give this a good read-through!
I'm going to throw the findings into a github repo as I go along.
Just for others, I found this a nice overview video on BlueTooth : https://www.youtube.com/watch?v=1I1vxu5qIUM
A ton of your devices use Bluetooth to communicate wirelessly. But how does Bluetooth work? In this video, we'll dive into the details of how your smartphone sends audio to your wireless headphones. Bluetooth is rather complicated and thus we're going to use a number of analogies and tools to explain it fully.
This video is sponsored by KIO...
https://github.com/hackgnar/ble_ctf_infinity/blob/master/docs/DEFCON_BLE_Workshop_Slides.pdf
This is pretty good too
Interesting, the Tower (the item I'm tracing the bluetooth protocol on) doesn't show up in lists of bluetooth devices, yet I do see advertiser broadcast packets. I'm guessing BLE has a broadcast option that allows you to say if the device advertising should show up on lists, kind of like how you can set a wifi device as 'hidden' and you have to know it's name to connect to it.
Probably this: "Scannable vs Non-Scannable: determines whether an advertising device is capable of handling a Scan Request message from an observer or central. Scan Requests and Responses are used to allow devices to advertise more data than can fit into one advertising packet."
Ugh, I can catch the device connection but I'm guessing it never gets on the proper channel for me to see the READ/WRITE cmds. I've disconnected/reconnect many times. I'm unsure if I'm doing something wrong or just unlucky.
If you download nRF Connect, do you see the device advertising?
Oh I see the advertising, and then I set the wireshark device to the device so I don't see everything and I see the device advertise and I see the connection, but the moment it connects I don't see anything else about it. I'm expecting to see READ/WRITE as I issue commands from the app that the device responds to.
Can you post a screenshot of post connection?
Here you go
The empty PDU's come immediately after connection. I do send commands after but not seeing anything really being caught for that.
Does the Sniffer’s LED turn red?
That’s my guess? But I haven’t been able to confirm it.
My concern is that there's a flaw in the firmware
I wonder if the py code is tripping up somehow
Could be. I know there's reference to Logs in there somewhere, so you may be able to see what the device is doing and if's crashing
I feel like it just goes off the rails somehow. Like there are lots of packets afterward, empty PDU which should be there, but they become all malformed. Once it goes off the rails its over and while it still captures packets they remail malformed. So annoying. I guess I'll have to figure out how to log the packets using iOS. This is the one time I actually wish I had Android.
I'm quite new to programming with bluetooth and am trying to understand how this works in general, especially with MCUs. My goal is to having a few very tiny MCUs communicate with each other with mere bytes of data intermittently.
Is there any good example that explains how to do this? I've only seen the 'scan for advertisements' example and that's it.
Bluetooth is fairly complicated, you can probably use a simpler protocol for that.
this is for a complicated wearable device with a lot of parts involved, and ideally I'd like to not have to rely on a wifi network
and introducing physical wire connectivity reduces the modularity of what I aim to do
WiFi is also complicated. I was thinking a simple ASK, FSK, or LoRa setup.
if it requires additional hardware that I don't already have then it's almost certainly a no-go
I take it your very tiny MCUs have Bluetooth support?
Yes, although I'm finding out there is apparently limited support with the QT PY ESP32-S3's BLE capability, at least with CircuitPython.
When you said "tiny", I was thinking something like an ATtiny, not a dual core 32-bit one!
I'm not sure how much that matters for my specific use case but it does seem to limit my options
I'm using them to drive display of an eyeball for each one, trying to use bluetooth to transmit a few bytes about what angle and eyelid closure value
with a brain also doing communication (might do a pico w for this) among several parts
to get an idea of the limited space I'm working with
That's a cool build
the display is a usb-c 1080p oled from AR glasses that I took apart, it's for my wearable PC project and this is the HELM for more fun cosplay stuff
and each eye is a 128x128 oled that I'm using a lens to expand the depth slightly in a mostly-reflective outer shell
I'm just wanting to use bluetooth to have each component go 'hey, I exist' with the brain going 'oh okay, let me signal some data to you' while ensuring a low power connection is loosely maintained
ESP32-C3 and ESP32-S3 boards currently provide an incomplete BLE implementation. Your program can act as a central, and connect to a peripheral. You can advertise, but you cannot create services. You cannot advertise anonymously. Pairing and bonding are not supported.
https://learn.adafruit.com/welcome-to-circuitpython/frequently-asked-questions#faq-3129409
I'll have to move closer to metal at some point eventually (not python), just been getting into microcontrollers only very recently.
If you’re using ESP32s, check out ESP-NOW. It’s a simple variant in WiFi that doesn’t require an access point and allows MCU to MCU communication. Much simpler than Bluetooth.
It won’t talk to the Internet though and is only supported on ESP32 devices. You can use it from Arduino or CircuitPython.
oh, sweet!
though I think I got past the problems I was having with my mobile router, so I might be able to just do regular wifi anyways
pi zero w 2 running RaspAP as a router and local portable network for my devices to communicate through, while also granting a wireless tether to internet
If you want to check it out anyway, here's the CircuitPython documentation for ESP-NOW
oh awesome, thank you!!
this turned out to be perfect, thank you again for telling me about it. I now have my helmet's eyes moving in sync thanks to the signaling from the brain module which is also esp32 👍
That looks really interesting. I wonder if there are any tools out there to interact with it 
Awesome, glad that worked out for you. Also that was fast! 🙂
What kind of tools do you mean?
Mobile apps, sniffers, etc. I plan to look into that later today. If nothing else, the SDR I have should be interesting
It's a special submode of WiFi. I don't know of any implementations other than for the ESP32 and ESP8266 CPUs, so apps won't be able to speak ESP-NOW directly. Sniffers should be able to pick it up but they'd have to be in WiFi monitor mode.
yeah monitor mode picks up esp-now frames, I used that for debugging, they’re just customized management action frames
Anybody have any idea how you go about getting the code to receive GPS from 32U4 and having it go to Google Maps on an ESP 32 web server I can log into an IP address and view the map
I can't get the code for the radio module 32U4 to parsing the GPS data raw data test passes radio to radio test passes but if I mix a parsing and try to transmit it it never goes through
I made it really far for not knowing how to do this at all
I've done a bit more research, and I think the Adafruit Sniffer is a bit defective for whatever reason. Maybe the bluetooth spec changed in a way it can't handle. Maybe the most recent software assumes a more recent firmware. It's not even a MacOS thing. The moment you do the steps to follow a specific device, the device crashes. The current firmware version for sniffers is 4.1.1 (https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE/Download?lang=en#infotabs), but the adafruit version is around 1.0.1. The FAQ (https://learn.adafruit.com/introducing-the-adafruit-bluefruit-le-sniffer/faqs) calls out that they got a custom firmware due to no 32khz crystal, and so you can't even flash the most current firmware on. I suspect Adafruit will have to request a new firmware image.
In the mean time, https://makerdiary.com/products/nrf52840-mdk-usb-dongle has instructions on how to flash it with the sniffer firmware and is pretty cheap.
Hmm. Nevermind, despite the angry red llight I'm still getting some connection traffic back and forth
I feel like @torpid echo might want to know that a product she is selling is only half working. It's been some time since she's visited the product, might be time to update it (or discontinue it) For sure the docs need to be updated.
Maybe @rough ivy Could make the BLE sniffer a product of the day and in the process iron out the issues we are seeing.
do you have a support forum post for the sniffer issues? That's the place to get official support
Ah I have not tried that path, I will do so, apologies!
Not very promising : https://forums.adafruit.com/viewtopic.php?t=205397
There is a download here: https://learn.adafruit.com/ble-sniffer-with-nrf52840#ble-sniffer-hardware-3107713 labeled 4.1.0. I was thinking you had updated, but are you looking at the original firmware?
Unfortunately that’s for the nrf52, while the sniffer device is nrf51. Good catch though. I’m now scouring my drawers to see if I have one of those
Yesssss 
So this is the latest firmware? Is there a way to tell what is currently installed?
https://github.com/DonutCables/PicoW_Game_Timers Background context for my project.
TLDR: Up to 6 peripheral devices sending maybe a 15 entry dict of data each to a central device, the central device sending smaller packets back including timer countdowns, and the central device also posting the info to a simple web page to be looked at.
The entire time I've been working on this so far I've figured bluetooth/ble is the way to go for the peripheral - central connectivity, but as I keep running into hiccups with that (Pico W having wifi but not ble on CP, Zero W having ble but not wifi on CP, ESP32S3 having both but some newer hardware weirdness, ble just being limited in general on CP right now) I'm finally asking for input on if I should consider something better suited.
Physical needs: Up to 300ft range with obstructions ranging from people+paintball cover to people+woods
Prefer to be able to have addressed bidirectional communication, but could probably get away with broadcast only if I didn't have a choice
I don’t believe the firmware will work as it’s for a different chip.
That's beyond the range of most Bluetooth implementations. However an ordinary radio modem would do well, or LoRa if you want to get fancy.
What could I realistically expect from ble, particularly when inside a box and under the lid of a bucket?
Also what differences would I get between "ordinary" radio and lora?
I don't think there's any way to give a realistic guess here. Range would vary depending on materials, how many and what kind of obstructions, transmission power, antenna design. There are a lot of variables.
So, had found that before and didn't see much that caught my eye, but this time I clicked "advanced usage" and the stuff with the address headers makes it seem much more useful
What's the likelyhood that I'd be able to send at minimum a timing signal from the central device once a second and then send back state data from the peripherals also at once a second reliably?
The examples seem to show a fairly slow frequency at 10 seconds
If you're okay working with ESP32s, you might consider using their "ESP-NOW" protocol - it's a point-to-point variant of WiFi. Its long range mode should get you better range than Bluetooth, especially if you use an external antenna. It's proprietary and not cross-platform though so you'd be using it only with ESP32s and ESP8266s.
Yeah LoRa is designed to be long distance but very slow.
Hmm, ESPs would also be cheaper than lora capable boards
Any sort of weird limitations I should know about before I start doing the funky handshakes to get CP flashed on these S3 boards?
Not that I can think of. The S3 is a very capable MCU. Maybe be aware that the UF2 bootloader is less permanent on the S3 than it is on the RP2040s. It's just another piece of application that gets loaded at boot. If it gets wiped you can always just reinstall it.
Yeah I don't think this project really entails anything that would risk writing over it
I've had a great time with the QT PY ESP32-S3s I've got so far, and utilizing ESP-NOW to communicate between several that I have was extremely easy
Yeah I've actually just managed to get two S3s doing some quick talking after I figured out I had to have their macs handy
yeah, as I've been planning out my project I nabbed each one's MAC address and physically labeled them to keep my stuff organized. working on a tons-of-parts wearable XR helmet
I'm a little sad I'll have to replace all the Picos I have for the project already, but I'm sure I'll find something for them later
I have a pico that's driving the 18 data lines for the RGB dreads I have, but otherwise I've been trying to keep everything smol. still need to figure out a solid way to communicate between it and my ESPs
Actually while I'm thinking, does ESP-NOW have a good way to guarantee packets are received?
not sure, but you can check failed and successful packet count
I've got a good 3-4 async tasks running at a time in the nodes right now and it seems like it'd be real easy for it to be able to miss a packet
I only just barely implemented it the other night and have been rewriting it since I was having an exception from trying to read from a packet when I think I wasn't supposed to
ESP-NOW frames are buffered, and you can increase the buffer size (especially on an S3)
Marvelous, though I did also realize I have no reason to be sending all of the timer to the nodes, I just need to send activate/deactivate strings
@dusky path https://learn.adafruit.com/ble-sniffer-with-nrf52840/working-with-wireshark this does have some info that could be useful. Namely that the Empty PDU packets are normal.
I did think the empty PDU packets were normal based on what I read, but what came after wasn't helpful. I don't know if it couldn't follow the connection as it hoped channels, or if there was some other problem.
At this point I believe that Adafruit is selling a non-functional product (half working or not).
I've pivoted and spent the $$ to join the apple developer plan. It was either that or buy a Android tablet... I feel I probably should have bought the tablet. Anyone have a recommendation of a cheap android device that I could do this type of stuff with? Has to run at least Android 10 (actually says 5.1 but I'd prefer not to be on the razors edge) and support Bluetooth LE (4.0).
you can also useNordic nRFconnect either on a tablet (Android in landscape mode best), or use it with a Nordic development board. It will download sniffer software for you to use and present the results in a nice GUI. See https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le
I'm a bit hamstrung there because the controlling app only runs on iOS and Android... and I have no Android devices sadly.