last day (21 days later) » 

8:21 AM
1
Q: Transmitting and Receiving messages through RF433 using Raspberry Pico

AntifaI'm currently working in a new DIY project, where I need to send a message through RF from Raspberry Pico, and receive it in an other Raspberry Pico through RF. I have bought some common RF433 receivers and transmitters (see image below) I'm using MicroPython. I have searched Internet to find pos...

 
(1) MX-05V is newbie firendly. (2) Arduino video tutorial, libraries, and demo code are easy to find. (3) Pico equivalent is not around, unfortunately. (4) Fortunately the code is not that complicated, so you can try to convert the Arcuino C++ code to Pico MicroPython (the other way around is more difficult, though). If you decided to use MX-05V, you might like to list the simple code and me or others might give a hint on how to convert it to python. PS, I once used use Arduino Decimilla 3V3 SPI RF12B and found it tricky to work with, But 5V MX-05V is much simpler. / to continue, ...
 
Thanks for your comment. I will try your proposal to convert Arduino library to RpiPico. Do you have any specific library recommendation?
 
Ah, I need to first look at the datasheet, to make sure if my suggestion makes any sense. 433MHz Wireless Modules MX-05 _ HobbyComponents forum.hobbycomponents.com/viewtopic.php?t=1324
I randomly googled and found this library. Now I am checking it out. HCWireless Arduino Library for 433MHz Wireless Tx & Rx modules - HobbyComponents forum.hobbycomponents.com/viewtopic.php?f=58&t=2914
The HobbyComponents does not provide any MX-05V datasheet. Other shops seems to link another chip: components101.com/modules/433-mhz-rf-receiver-module.
This tutorial looks better: How to use 315Mhz RF Transmitter and Receiver Modules (MX-FS-03V / MX-05V) with Arduino myhowtosandprojects.blogspot.com/2014/01/….
And this looks like a good library: VirtualWire Library VirtualWire, by Mike McCauley (PDF), helps you use very inexpensive wireless radio modules - PJRC pjrc.com/teensy/td_libs_VirtualWire.html
 
I will check and I will get back to you
 
OK. BTW, documentation is very good: airspayce.com/mikem/arduino/VirtualWire.pdf
Just now I tried to download VirtualWire in my Windows 10, but no luck. I have no Arduino staff in my PC Windows, and no Arduino in hand. It would be nice if you can installed VirtualWire somewhere and pass me a copy of the source code, then I can skim through it and see if it would be easy just to translate the bare bone part and try it in Rpi Pico MicroPython.
 
8:21 AM
I have found this VirtualWire library for Pi. Indeed it is not for Pico. Also this source code has a dependency to RPi.GPIO which is not for Pico also. quadmeup.com/virtualwire-support-for-raspberry-pi
 
Oh my goodness. piVitrualWare is many times better than original VirtualWare for Arduino, because is it already in python, therefore saves a lot of C++ to python conversion time. However, there are two small problems: (1) As you said, it is using Rpi built in Rpi Gpio module, which is not the same as the Pico GPIO module. I think it easy to do the almost trival one to one conversion. (2) The PiPGIO thing a bigger problem:
(a) it is sort of a daemon thing, meaning that you can only run it in the background, (b) I heard that PiGPIO might not run smoothly on Rpi4B, because of system timing problem. And Pico is no multitasking OS like Rpi OS, so the timing problem might be more tricky to handle. But I think we can do these: (i) study the PiGPIO source code, and see how it interface with the daemon, and the main idea of the MX05V control, (ii) then rewrite the VirtualWire thing starting from afresh, ...
With PC Windows Thonny Rpi Pico MicroPython. I think it is not a complicated job at all. PiVirtualWire can be downloaded to Rpi or Windows, but I have not played with linux CLI commands for over a year, and don't have a working Rpi4B in hand (I have 5 working Pico's in hand! :)) So it would be nice if you can do the following for me:
(A) Down load the PiVirtualWare in any platform you like, (A) Pass me the complete python code listing. I guess the complete listing should be shorter than 500 lines. I will study the code and guesstimate how long it would take me to do a quick and dirty conversion, perhaps only the transmit part, to prove the concept.
Nothing urgent, please take your time. BTW I already ordered a couple of the real thing, they should arrive in 2 working days: item.taobao.com/…. Cheers.
 
 
2 hours later…
11:09 AM
You mean this?
I have found also this, but it lacks some functions.
https://forums.raspberrypi.com/viewtopic.php?t=315919&p=1889836
 
11:31 AM
Ha, your two links are very helpful, and the first link is almost what I want, actually better than what I want. I am sorry I don't express myself clearly and caused the confusion.
Let me try again. (1) the piVirtualWaire library is what I want to explore further. But I don't have any Rpi4B or other linux thing in hand, and I don't want to setup Rpi4B just to install the piVirtualWire. So I thought you might help to install the piVirtaulWire in your Rpi (I assumed you have Rpi3/4, and you have experience using Rpi OS and linux CLI commands like Make etc),
get the python listing and send me a copy. But this is NO longer necessary, because you first link is what almost what I want, or even better. Anyway, I will now look at your first link and see how useful it is.
Now your second link about a "shim" useful to those who want to run Rpi python programs (using Rpi built in GPIO or GPIOZero modules) on Pico. This shim would convert the original Rpi porgram to run in Pico and run it there. This clever thing is of course useful in general, but not for our situation, because using the piGPIO, a daemon thing, which I think the above shim cannot handle.
This might be a bit complicated, but not too important, because if the first link's source code is complete and not too long (as I have guessed, less than 500 lines), it might be easy to rewrite part of the code initializing Rpi GPIO pins to Pico GP pins.
Anyway, you have already helped a lot in this research part. Perhaps you can now take a break, sit down and let me skim your first link's piVirtualWire code and see how useful is it.
 
12:01 PM
I am back. I went to your first link on VirtualWire: github.com/DzikuVx/piVirtualWire/blob/master/piVirtualWire.py
I found the guy written this piVirtualWire uses joan's piGPIO which is a GPIO module similar to Rpi's GPIO or GPIOzero, but in the form of a daemon, running on the background, and have special functions, like timing interrupts, callback functions, PWM etc. I have never used this piGPIO before, because I don't need those special functions based on a daemon.
I have skimmed the VirtualWire library and found it a simple library with two basic functions, (1) sending a message, (2) receiving a message, both using one pin. There are also CRC functions, but not important in our application.
Of course I am only guessing. I tend to think that piVirtualWire (or VirtualWire) is just a software utility based on serial communication stuff, ie RxTx, UART etc.
So there is a big chance if we use Pico python SDK's UART functions, we can write something similar of piVirtualWire.
As I said earlier, my MX05V toys might arrive the day after tomorrow. I will then do the first basic experiments: (1) Just power up the transmitter module, and input some rubbish data, say a square wave pulse to the output pin, and (2) at the same time, set up the receiver module, and use my scope to display the waveform at input pin.
I am assuming that the xmit and recv module start to operate automatically when powered up, it is only we need hardware or software (VirtualWire) to encode and decode the messages send/receive.
You might like to google more tutorials or videos to see if my guesses make sense, or wait until my MX05V toys arrive when I will verify my guesses.
 
12:23 PM
thank you very much for the support
 
Ah one more thing. I forgot to mention that components 101 mention a complicated encoder and decoder, which is not used in our cheap cheap moduels. components101.com/ics/ht12e-encoder-pin-diagram-datasheet
You are welcome. I once played with similar RF modules RFM12B and nRL2401+. I have never played with MX05V before, so it is a good chance to update myself. How nice we can learn together. Cheers.
 
1:00 PM
Just now I watch this tutorial a second time: Arduino RF Tutorial [Using VirtualWire] (MX-05V / MX-FS-03V) 18,712 viewsJan 19, 2014
https://www.youtube.com/watch?v=cplAjvAAEDw, and I found I made a wrong guess: The receiver module will NOT start when powering up, we need to use a VirtualWire function to start it up. So ignore my wrong guess I made earlier.
 

  last day (21 days later) »