RFM69HW demo application for blue pill?

Post here first, or if you can't find a relevant section!
turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

RFM69HW demo application for blue pill?

Post by turboscrew » Sun Dec 17, 2017 1:22 am

Does anyone know a demo application for blue pill that at least sends some data using RFM69HW-module?
I can receive data that I send from another blue pill using CC1101-module, but it looks like I haven't got the RFM-module to send anything.
(Well, from CC1101 to another CC1101 the data transfer is fine, but the receiving RFM seems to loose the bit sync.)

It looks like as if the RFM sends the messages (frame sent interrupt), but a receiving CC1101 doesn't even see any change in the RSSI.

I'd just like to see that the RFM-module is able to send something, and maybe even discover what I've been doing wrong.

User avatar
mrburnette
Posts: 2220
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: RFM69HW demo application for blue pill?

Post by mrburnette » Sun Dec 17, 2017 1:47 am

Start here, from a year back in time:

viewtopic.php?t=1582

Ray

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: RFM69HW demo application for blue pill?

Post by turboscrew » Sun Dec 17, 2017 10:54 am

I checked those, but there seems to be quite some porting to do, and they are libraries.
For those I'd have to start a new project in the middle of my current project.
My current project is done in plain C (and a bit of assembly) and without any libraries. (Well, I use stdint.h, but everything else is my own writing.)

But if I have to port a library, so be it. In that case, which one would be smaller job?
I already installed Arduino and Arduino_STM32 just to be ready.
I really wouldn't like to use HAL-libraries.

User avatar
mrburnette
Posts: 2220
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: RFM69HW demo application for blue pill?

Post by mrburnette » Sun Dec 17, 2017 10:51 pm

I did a Google search against github.com

Code: Select all

rfm69 stm32f103 site:github.com
and found this, but unless you can contact the author, the validation will be upon you. This is typically why I write my own stuff.

https://github.com/brainelectronics/RFM69-STM32

IMO, unless you absolutely want to build a library for some specific C++ "class" reason, you could just use a multi-tab Arduino project and write specific functions. Libraries can be a big pain in arse.

Ray

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: RFM69HW demo application for blue pill?

Post by turboscrew » Tue Dec 19, 2017 1:36 pm

I tried to replay earlier, but the site seemed to have some problems...

Yes, the RFM69-STM seems to be a "subset" of the LowPowerLab-library. Made me think, maybe that'd be less porting...
What's "a multi-tab Arduino project"? I'm very new to Arduino.
I've mostly written my own programs without any libraries, and using C/assembly.
(I've been interested in learning about HW interfaces, not about learning the interfaces of some - often huge - libraries.)

User avatar
mrburnette
Posts: 2220
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: RFM69HW demo application for blue pill?

Post by mrburnette » Tue Dec 19, 2017 2:23 pm

turboscrew wrote:
Tue Dec 19, 2017 1:36 pm
<...>
What's "a multi-tab Arduino project"? I'm very new to Arduino.
I've mostly written my own programs without any libraries, and using C/assembly.
<...>
Let look at a new project:
SingleTab.png
SingleTab.png (9.66 KiB) Viewed 212 times
And a multi-tab project:
MultiTab.png
MultiTab.png (14.18 KiB) Viewed 212 times
Essentially, the idea is to gather all of the code necessary in the project so that the compiler/linker can build the code without concern for external libraries... other than those included with the IDE (these seem to be better regression-tested, IMO.) One really cannot rely upon a 3rd party library to not change and break older code. So, why risk it... Hard Disk space is very cheap ... on an older machine, just ZIP up the project if you are concerned about space.

The #include syntax changes a wee-bit because our 3rd party libs are encapsulated:

Code: Select all

#include <Streaming.h>  // Using library Streaming in folder: \Documents\Arduino\libraries\Streaming (legacy)
#include <Wire.h>       // Using library Wire in folder:      \Documents\Arduino\hardware\STM32\STM32F1XX\libraries\Wire (legacy)
#include <SPI.h>        // Using library SPI in folder:       \Documents\Arduino\hardware\STM32\STM32F1XX\libraries\SPI
#include <SD.h>         // Using library SD in folder:        \Program Files (x86)\Arduino_158\libraries\SD 
#include "I2Cdev.h"     // Sketch folder
#include "BMP085.h"     // Sketch folder
#include "NokiaLCD.h"   // Sketch folder: Nokia 5110 LCD pin usage as controlled by "ScrnFuncts.ino"
#include "SDcard.h"     // Sketch folder: Generic SD Card defines and constants
And .cpp files with accompanying .h headers take on this syntax:

Code: Select all

// I2Cdev library collection - BMP085 I2C device class
// Based on register information stored in the I2Cdevlib internal database
// 2012-06-28 by Jeff Rowberg <jeff@rowberg.net>

#include "BMP085.h"
Again, the headers are local to the project, so no path is required.

One thing I like to do is to create a tab called Notes.h
In this tab, everything is a comment, that is, between /* and */
This is a great place to paste code that you intend on modifying ... copy the section, paste it in Notes.h and edit ... if you need to regress, the original copy is available. Brainstorm with yourself and work with a safety-net.

When all is said and done, one can ZIP up the project and share it knowing that time will have been frozen for 3rd party library updates. For an author, this eliminates more support dialog than one can imagine! And, since my main tab identifies the ArduinoIDE version, the end-user can go to Arduino.cc and install the exact IDE version to ensure that the project compiles, link, and hopefully uploads :lol:

Many more examples of simple projects on my projects page.

Added: regarding writing your own library...
One of the nice obvious features of encapsulating libraries is that you can now hack-the-heck out of them and never affect any /Arduino/libraries code. This means that you can port the library in-place or you can cut or modify stuff you do not need. With the barometer example I used earlier, I took a lots of poetic license. Just ZIP the project folder before you edit and you can always regress back to an earlier time. Smart programming means smart planning.


Ray

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: RFM69HW demo application for blue pill?

Post by turboscrew » Tue Dec 19, 2017 2:26 pm

Loads of thanks!
You, mrburnette, seem to have a quite nice collection of projects. :-)

Now that I've looked further into the codes of the libraries, it looks like LowPowerLab-library and it's derivatives are much easier to port for blue pill. At least it looks like it uses Arduino libraries, that are already installed when I installed the Arduino and STM32-core. Porting HAL-based stuff seem much more laborous.
Last edited by turboscrew on Tue Dec 19, 2017 9:17 pm, edited 1 time in total.

User avatar
mrburnette
Posts: 2220
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: RFM69HW demo application for blue pill?

Post by mrburnette » Tue Dec 19, 2017 2:43 pm

To dramatically show the difference, last year I took an ESP8266 Arduino project and ported it over to a multi-tab project - essentially not adding any functionality ... or value!

The Sniffing2 is my first working rendition of code as the original author's version which did not compile successfully.
Sinffing6 is the same code in an organized Arduino multi-tab project.

Ray
Attachments
Sniffing6.zip
(5.87 KiB) Downloaded 6 times
Sniffing2.zip
(4.22 KiB) Downloaded 3 times

turboscrew
Posts: 78
Joined: Fri Mar 10, 2017 7:36 pm

Re: RFM69HW demo application for blue pill?

Post by turboscrew » Tue Dec 19, 2017 9:11 pm

Is that a way around "single file application"?
It looks like the application is supposed to be contained in a single .ino file, and anything bigger should be broken into libraries.
At least it seems hard to open other kind of files.
And a bit bigger chunk in a single file is really a P.I.T.A.

(Like I mentioned, I'm _very_ new to Arduino, even if I have about 20 years of experience as an embedded SW programmer.)

fredbox
Posts: 98
Joined: Tue Jul 07, 2015 4:44 pm

Re: RFM69HW demo application for blue pill?

Post by fredbox » Tue Dec 19, 2017 9:47 pm

Each folder will have only one .ino file that is your main application. Additional tabs will be .cpp and .h files.

You can choose to create custom libraries if you want, but for many projects they add unnecessary complexity. If you do use 3rd party libraries, it is suggested that you copy the libraries into the folder with your sketch. I've had projects where the library folder was updated and it broke something. I have one project that is 20+ tabs and the only library used is Streaming. Everything else is standard C code in a .cpp file with a .h header.

I typically only have setup() and loop() in my .ino file with everything else in external cpp and h files.

Post Reply