B4R Question B4R Compatible Hardware

MarrowZero

Member
Licensed User
Hello all,

I fancy a new project and B4R is interesting. I'm thinking about measuring the temperature of the household hot water system (sensors clamped to copper pipes on the water tank). Maybe it we help to understand how long the water remains hot and means the gas boiler might have to switch on a little less this winter. It will be interesting to see times to heat up, peak temperature and the time for the temperature to decay. The project I'd like to build with my daughter (we already have a lot of fun with B4J and B4A) and I'm going to make a rule that it MUST be powered from a renewable power source (once we've got something on the bench working). We can play with solar + battery charging etc, maybe wind.

I'm thinking ESP32 + multiple DS18B20

How do I choose which ESP32 board to use? There seems to be 1000000000000000000 versions available. I'm concerned that I go ahead and buy something that later I find is not 100% correct to use with B4R. Would be nice to choose something where a plastic project box is available and maybe a small lcd screen later (although we'll write a B4A app to display the data)
The m5stack boards look very easy to start with, but I think I read there is some incompatibility with B4R ?

The temperature sensors seem easier to select and there seems to be people on this forum that have used the DS18B20 before, with the 1-wire/Dallas library already available.

Where should I buy my ESP32 board from in the UK ? (which are you favourite websites and known to be B4R friendly)

Thanks for any help
--Paul
 

hatzisn

Well-Known Member
Licensed User
Longtime User
Why do you care which board to use? The only thing that changes between boards is the pinout. As long as you find the pinout you will be ok. There are though other things that might bother you. I have bought the ESP32CAM and the logs did not show in B4R. I was able to upload the project but no logs. You may want to keep this in mind. When I opened the created by B4R ".ino" file in Arduino and compiled the code from it I was able to see logs in the Arduino serial form.
 
Last edited:
Upvote 0

RJB

Active Member
Licensed User
Longtime User
Take a look at the Lilygo TTGO board. Esp32, battery charging and built in display. Though it looks like the price has gone up quite a lot recently. I have bought them from Ebay in the UK but they are available from international sellers elsewhere.
It is B4R compatible. I have 3D printed a box for it (with or without battery included) and it makes a neat package.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
IMHO, i see the situation so, help me to fix anything if i'm wrong:
  1. The chipset is developed by a vendor. Chipset's software SDK is developed by it also.
  2. A product PCB (using this chipset) is developed by a OEM producer (of PCB). Some trade name of the PCB is invented by it also.
  3. Each chipset have a initialization procedure (hardware and software manipulations) that can be implemented differently on different PCBs from different producers (but with the same chipset). But the correct process must be only one, to use with any board of the selected chipset.
  4. Arduino libs with hardware (board) support are developed for exact mentioned board variants - so, we have to choose the proper lib, and it will show a list to choose the trade names of supported boards. But the main is still the chipset name.
  5. So if a board has the correct implementation (circuit diagram of the init pins) of the chipset - it can be used in development choosing any compatible board of the chipset.
  6. But if something is wrong in the PCB circuit - it will not work even with correctly chosen board model in settings. Many, sure, depends on the lib software, SDK that also can be with errors.
 
Upvote 0

RJB

Active Member
Licensed User
Longtime User
In case it helps:
I use the "ESP32 Dev Module" in tools/ board selector. It seems to work with many ESP32 boards (including my own WROOM32 based design).
Also search for "bodmer display driver" (particularly on GitHub) for info on using the display on the TTGO and other boards (again also works on my board)
 
Upvote 0

MarrowZero

Member
Licensed User
I see the word WROOM32 but I don't understand its relationship to the "esp32 boards". Is WROOM32 a brand, pcb, or specification?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Just use google. For this case it looks like name of the module PCB. Where the ESP32 chipset is soldered. And this module is a separated product for embedding into your PCB. Above it was replied, just use "ESP32 Dev Module"
 
Upvote 0

RJB

Active Member
Licensed User
Longtime User
Yes, on the esp32 development board its the actual processor etc. (i.e. the 'tin' box with the aerial attached). You can design your own boards using just it and a few components, depending on what you need to do.
The esp32 development boards also include the USB input/ power connection, power regulator, programming circuitry (to automatically restart after programming e.g. from B4R) and the pins that make it easy to connect it to a breadboard for prototyping.
 
Upvote 0

MarrowZero

Member
Licensed User
Lilygo TTGO board arrived! I don't have time just now to attach to computer + B4R, but I was so excited I had to plug the battery pack in.... (IT as a job can suck, but IT as a hobby is still fun after 25 years)

1661895867431.png


1661895902483.png

LCD screen protector is still on (sorry for slightly fuzzy photo)

1661895953141.png


1661896056040.png


Cool!
 
Upvote 0

RJB

Active Member
Licensed User
Longtime User
You should be able to connect it to the PC via USB, select File/ New/ ESP, select the 'ESP32 Dev Module' in board selector and write a simple 'hello world' to the log straight away.
Using the display is a bit more involved and that's where Bodmer comes in, you will need to do do some reading when you get to that stage!
 
Upvote 0

MarrowZero

Member
Licensed User
I found some minutes to install B4R and connect the ESP32 board up, however, I cannot see the reference to 'ESP32 Dev Module in board selector' - any help please ? (BTW, I have not read the manual... sorry)

1662055302727.png
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Read any manual and start setting up the Arduino IDE. Understand that B4R is a transpiler over Arduino.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Now check the boards list in Arduino and in B4R and compare...
 
Upvote 0

MarrowZero

Member
Licensed User
Now check the boards list in Arduino and in B4R and compare.

A much larger range of boards now show in B4R (I shall assume them to be equal). I tried 'ESP32 Dev Module' and 'TTGO T1' and both appear to work. Not sure how to select the "correct board"

Time to try some examples :) This is fun!

1662057246174.png
 
Upvote 0

RJB

Active Member
Licensed User
Longtime User
Sorry, forgot that stage - it's been a long time!
I don't know what the T1 is. The 'ESP32 Dev Module' works for me so that's what I use.
Other things worth noting:
As you may have found, the first compile can take a very long time even with a very small programme, after that it's quicker though you might still need to change the timeout in the IDE.
The Stackbuffer will need increasing as the programme gets bigger (at the start of the file '#StackBufferSize: '). So, if you get strange problems try increasing it (mine's at 15000 in one large, complex programme !!)
There can sometimes be problems with other equipment plugged into USB ports on the PC at the same time (or even sometimes after they have been removed). I particularly have problems when using 3D printers and Cura software. Disconnecting the other device, restarting B4R, disconnect/ reconnecting the ESP and restarting the PC have all seemed to clear the problem at one time or another.
If you store anything in the Arduino directory (e.g. in the libraries) then make sure you keep backups. You might lose them if you update the Arduino version otherwise!
Sorry if these things are obvious but just in case they help!
 
Upvote 0
Top