PJON

rajdarge
Mon Apr 25, 2016 11:47 pm
Trying to modify the PJON library to suit a STM32F103RB (Blue pill).
In order for the Library to compile I need to know what the name of my board is to the compiler
like ESP8266 … etc.
I have already tried.
GENERIC_STM32F103R

WereCatf
Mon Apr 25, 2016 11:59 pm
Use __STM32F1__

rajdarge
Tue Apr 26, 2016 5:48 am
so I tried this and get the response:
WARNING: library PJON claims to run on [avr, esp8266, sam, samd] architecture(s) and may be incompatible with your current board which runs on [STM32F1] architecture(s).

and the same compilation errors.


WereCatf
Tue Apr 26, 2016 6:03 am
rajdarge wrote:so I tried this and get the response:
WARNING: library PJON claims to run on [avr, esp8266, sam, samd] architecture(s) and may be incompatible with your current board which runs on [STM32F1] architecture(s).

and the same compilation errors.


zoomx
Tue Apr 26, 2016 6:04 am
In the library.properties file there is a line which describes the architecture supported by the library.
architectures=avr,esp8266,sam,samd

RogerClark
Tue Apr 26, 2016 10:00 am
Looking at the code, you’d also need to add special implementations in digitalWriteFast for STM32 (libmaple)

https://github.com/gioblu/PJON/blob/331 … riteFast.h

Good luck with doing that, as it looks like rather convoluted.
Goodness knows why they implemented it with using the preprocessor to the extreme.
There are other projects which use fast GPIO access e.g. the OneWire lib and the fast GPIO access code is not so complex.

I’d be tempted to fork the repo and just replace that file altogether


rajdarge
Tue Apr 26, 2016 11:36 pm
zoomx wrote:In the library.properties file there is a line which describes the architecture supported by the library.
architectures=avr,esp8266,sam,samd

RogerClark
Wed Apr 27, 2016 12:15 am
I just meant that the direct / fast access to the gpio in this was written in what appears to be a very complicated way.
I used OneWire as an example of a library that does direct hardware access in a simpler way.

I didn’t mean that you can use OneWire to communicate, rather than this library.


rajdarge
Wed Apr 27, 2016 1:31 am
RogerClark wrote:I just meant that the direct / fast access to the gpio in this was written in what appears to be a very complicated way.
I used OneWire as an example of a library that does direct hardware access in a simpler way.

I didn’t mean that you can use OneWire to communicate, rather than this library.


RogerClark
Wed Apr 27, 2016 1:37 am
There used to be a library called Virtual Wire, that did comms between Arduinos, but it looks like it got swallowed up by the RadioHead library and is now discontinued

http://www.airspayce.com/mikem/arduino/VirtualWire/


mrburnette
Wed Apr 27, 2016 1:17 pm
RogerClark wrote:There used to be a library called Virtual Wire, that did comms between Arduinos, but it looks like it got swallowed up by the RadioHead library and is now discontinued

http://www.airspayce.com/mikem/arduino/VirtualWire/


mrburnette
Wed Apr 27, 2016 1:30 pm
rajdarge wrote:
<…>Having the esp sitting there without utilizing its power seems such a waste.

rajdarge
Wed Apr 27, 2016 10:33 pm
mrburnette wrote:IF you are not using the RF, you can disable it easily. Then just use the ESP8266 as an Arduino and forget about the WiFi part.

mrburnette
Thu Apr 28, 2016 2:34 pm
rajdarge wrote:<…>
So the current configuration is this:
I2c devices: RTC, Fuel Guage
SPI devices: TOuch panel, TFT panel, SD card.
One wire devices: 5xDS18b20
PIR, BUZZER, WS2812b (as a status light).
<…>

rajdarge
Thu Apr 28, 2016 7:28 pm
mrburnette wrote:My philosophy is to design smart… just because an STM32F103 is running at 72MHz and (neglecting optimizations) has 72MIPS and 20K of SRAM, a good design will not go over perhaps 70% of the bandwidth and memory capability. Sometimes, one may design a bit higher, say 80%, but only if the uC and peripherals are ‘well understood’ and critical timing is not mandatory.

mrburnette
Thu Apr 28, 2016 8:57 pm
rajdarge wrote:<…>
It is meant to monitor a Vaccine fridge.
<…>
In my travels solving the time issue was the most difficult (and inter arduino comms). I get NTP time, and I use WUNDERGROUND to obtain the current TimeZone offset and Daylight savings offset, (as well as local weather conditions as a bonus) based on GPS coordinates For display on the device. I haven’t connected a GPS device as the vaccines are indoors, <…>
<…>
Most of the problems I have already solved and implemented.
No I am not planning to make this a commercial device. It really only for my use and the use of staff.
<…>
correct me if I am mistaken but isn’t that the way the easytransfer library works? I am reading up on struct memory management at the moment as EasyTransfer given examples of int’s and floats but I also use c_strings (char), but are Strings a bridge too far? I was already working on sending a struct or a class over the wires, but didn’t know enough about either data device to really implement it.

rajdarge
Thu Apr 28, 2016 11:10 pm
mrburnette wrote:OK… great info and should have been in first post as it helps. With non-commercial stuff, it really helps to have the full picture.

rajdarge
Thu Apr 28, 2016 11:32 pm
External Logical controller:
Isn’t that what I’m kinda doing with the esp?
The esp functioning as a black box and sending stuff to the internet and telling the STM that all that stuff is ok, so don’t you worry your pretty little head about it.
I wish I had the time to fiddle with the fridge compressor and make it controllable as well, but I don’t – so that’s probably a good thing :)

mrburnette
Thu Apr 28, 2016 11:52 pm
rajdarge wrote:<…>
Thanks for he confidence boost. I have good problem solving skills, but my programming skills are poor with C++, the syntax still throws me. As far as experience goes: I taught myself machine code, and then MacroAssembly on 6502 when I was 13, I learn a little bit of electronics (transistors, opamps, diodes, etc as a 13 year old).

rajdarge
Fri Apr 29, 2016 12:03 am
Ok well I can afford to put my project on hold and learn C++ the easier way. Sorry about the old man status – wear it as a badge of honour :)

ahull
Fri Apr 29, 2016 12:20 am
rajdarge wrote:Ok well I can afford to put my project on hold and learn C++ the easier way. Sorry about the old man status – wear it as a badge of honour :)

martinayotte
Fri Apr 29, 2016 1:06 am
Wow !
105 years old !
He’ve seen lot of technologies (from Morse code Radio to Ethernet) … :)

rajdarge
Fri Apr 29, 2016 2:03 am
One more quick question: regards the PJON library. I would still like to help get it up to steam for use by everybody as i think it has a lot of merit. If it can then also send Structs it would be perfect. To finish modification I need to work out how to do the pin mapping. Is there a document I can read that will shorten this process. I’ve tried reading the datasheet on the STM32F103RBt6 but much of it is gobbeldygook to me. So is there something for the non-engineering minded?

mrburnette
Fri Apr 29, 2016 11:50 am
rajdarge wrote:<…>To finish modification I need to work out how to do the pin mapping. Is there a document I can read that will shorten this process. I’ve tried reading the datasheet on the STM32F103RBt6 but much of it is gobbeldygook to me. So is there something for the non-engineering minded?

WereCatf
Fri Apr 29, 2016 12:48 pm
Yes, that picture does apply to the Blue Pill, too, I have tested since I own a BP myself.

rajdarge
Fri Apr 29, 2016 9:23 pm
I suppose more specifically is how to address the DDR for each port?
PA PB PC …

mrburnette
Fri Apr 29, 2016 10:07 pm
rajdarge wrote:I suppose more specifically is how to address the DDR for each port?
PA PB PC …

rajdarge
Sat Jun 18, 2016 11:25 pm
rajdarge wrote:Ok well I can afford to put my project on hold and learn C++ the easier way. Sorry about the old man status – wear it as a badge of honour :)

fari
Sun Feb 26, 2017 4:20 pm
Hello everybody!

I have migrated the library of Youen Neuoy to STM321f103 (Arduino). You have got the advantage, that the polling does not bloc your micro, since the communication is interrupt based.
Some timing constants have to be adjusted, if you change your Arduino compiler options!
I have fixed one bug, which caused a total deadlock of the onewire network. Still there are few telegram errors (app. 1%)
Unfortunately I do not own a logic analyser and could not trace the cause of this error.

I have signed into gitHUB and tried today to upload the library, but I could not. If anyone is interested to get it immediately, I could make it available via google drive or via email!


RogerClark
Sun Feb 26, 2017 8:55 pm
Thanks

Let us know when its in GitHub, and post the link so people can download it


stevestrong
Fri Nov 09, 2018 10:08 am
So is there any port of this lib for STM32?
Or does the original lib work out of the box for STM32F1?

zoomx
Fri Nov 09, 2018 12:37 pm
https://www.pjon.org/
Seems that it works on a bluepill.

stevestrong
Fri Nov 09, 2018 12:40 pm
What makes you think that it works on blue pill? Have you tested?

fpiSTM
Sat Nov 10, 2018 5:09 am
Probably because it is in the Compatible devices list ;)
Searching in the GitHub, it seems it can be used with Roger’s core:
https://github.com/gioblu/PJON/issues/60
https://github.com/gioblu/PJON/issues/212

stevestrong
Sun Nov 11, 2018 7:40 am
Yep, it seems that this commit should add some support for F1.

Leave a Reply

Your email address will not be published. Required fields are marked *