Send data via Bluetooth

Same error. I will try to get the basic example running tomorrow and report back once this is solved.

Thanks so far for your kind support!

maybe your installed 2.0.5 library is having an issue… Maybe you have 2 library directories (a leftover from the previous install).

Else try this :

closedown the ArduinoIDE

Remove the 1.2.1 and 2.0.5 folder in the directory mentioned in an earlier post to check the library.

start Arduino IDE again

reinstall the Apollo3 library 2.0.5

select your Apollo3 board

try again BME280

I did delete and reinstall the board package and the libraries. The BME example now compiles.

However, the peripheral still throws an error:

‘class Serial_’ has no member named ‘printf’; did you mean ‘print’?
in line 167 and 348.

Looking at the documentation of the Serial class, I also do not find the printf function.

Changing it to print, throws the error:

no matching function for call to ‘print(const char [42], const char [9])’
In my understanding, this means that print cannot handle this data.

I have been browsing some forums already and there might be a workaround, but I presume you used printf for a reason and it did compile for you…

Which board is selected?

which board library version have you installed ?

does the BME280 example1 now compile ?

Maybe share a text document with the compile output.

Sorry, I did not select the Edge board again. Selecting the Edge board, I am back to where I was:

The Basic Readings BME example does not compile because “SPI was not declared in this scope” with the Edge board. Board library is 2.0.5.

By the way, in the Arduino guide for Edge from Sparkfun (https://learn.sparkfun.com/tutorials/pr … rduino/all), they provide another .json file which offers different versions for the board. In order to get the 2.0.5 you recommend for this example, I have to use the Apollo Core from here https://github.com/sparkfun/Arduino_Apollo3. May this cause some issues? Are there actually two different board packages developed then?

OK… the issue is clear now. The EDGE board does not have SPI and as such SparkfunBME280 will not compile. It has I2C / Qwuic which is planned for BME280 usage.

You can either decide to

  1. use Arduino BME280 library instead and make the necessary changes.

  2. OR we fake the system. in 2.0.5/variants/SFE_EDGE there is a file variant.h.

Open this file with an editor

on line 13 it states

#define VARIANT_SPI_INTFCS 0

replace that with :

//#define VARIANT_SPI_INTFCS 0  
#define VARIANT_SPI_INTFCS  1	// faking system
#define VARIANT_SPI_SDI     30
#define VARIANT_SPI_SDO     31
#define VARIANT_SPI_CLK     32

save that.

These pins are not used on the Edge anyway. It does not give you SPI, but now it should compile without errors

I went with Faking It for now :wink:

It works! Upload also works!

Since I do not have a second Edge board yet, I will try to get the serial readings send out over Bluetooth displayed on my laptop. I will need to start digging into this a bit myself before I post more questions :slight_smile:

Thanks again and have a good weekend!

Okay, so I have now tried to find the edge boards BLE signal on my phone through nrf connect app (I followed your description in the peripheral header example). I have tried it on a Moto G8 Power and Moto G5, the latter should support BLE for sure. I do not see the board.

I have added the following line to check whether the board does indeed go into advertising mode:

BLE.advertise();

SERIAL_PORT.println(BLE.advertise());

And it prints “0”, i.e. BLE.advertise() fails. The COM port also displays that BME did not respond but that may be an independent issue, here is the full COM output:
⸮Apollo3 BME280 peripheral. Compiled: 11:35:47
0 (comment: this is the output of the new line asking for BLE.advertise())
The BME280 did not respond. Please check wiring.
Ready to go …
local address 66:77:88:23:bb:ef
local name Artemis peripheral BME280 BLE

In the header of the file, there are not terribly many options. Do I have to change this “service ID” 19B10010-E8F2-537E-4F6C-D104768A1214?

Danke je :slight_smile:

changing the service ID will not make the difference. if advertising fails then of course you will not see BLE.

I have just connected my Edge board, made the SPI change to fake the system, compiled the sketch as it is… no BME280 connected it and it works. I can find it witl nRf tool

12:01:17.444 ->⸮Apollo3 BME280 peripheral. Compiled: 12:00:44

12:01:18.440 → The BME280 did not respond. Please check wiring.

12:01:20.598 → Ready to go …

12:01:20.631 → local address c0:dd:80:c1:f:5

12:01:20.631 → local name Artemis peripheral BME280 BLE

Please go back to the very original sketch that I posted and use that.

I pressed again RST on the board and now it works :slight_smile: Interestingly, the BLE.advertise() is still set to 0.

I can also see it on my laptop now, it is not connecting though. Maybe more generally speaking, since the sketch designed for two edge boards, would you say it is much of a stretch to tweek the peripheral code for BLE communication to the laptop? The alternative would be buy another edge board, run the code as is and connect the second edge board through USB to the computer. Of course, the first solution would be more elegant…

the sketch generic BLE, not only for 2 edge board. you can connect with rnf or any utility. I can connect from my Ubuntu without issues.

That sounds good. I am currently thinking what is the best (better said, easiest) way to connect my laptop to the edge board then. Ideally, I would like to do this through Python because the script that builds bitmaps from the raw images from the edge board camera (hm01b0) is written in Python and I am already familiar with it. Therefore, I am trying to do it through the PyBluez package in Python on a Linux machine but it seems that the package is not well maintained and documented. Before, I dig too deep in this direction, would you recomment another way to establish the connection and receive data from the board? Thank you very much!!

I am using Bluez (http://www.bluez.org/), but I am trying to get this going in ‘C’ instead of Python. They have example in python as part of there code in their “test” folder.

Thanks. I got BlueZ working from my Ubuntu terminal and could also detect and connect to the Edge board which had your peripheral arduino file running. So good, so far. However, it is not clear to me how one would read incoming data from the board. I also looked at the .py files in the BlueZ test folder but cannot see that any of the scripts would do this. Are you able to display received data through BlueZ?

Since the edge board has no BME280 sensor attached, I guess I would still expect some error readings?

I got the BLE working now and could write a minimal example myself from scratch which sends messages that I receive with my Linux machine using gatttool. Quite happy about this :slight_smile:

Now I need to combine this sketch with the sketch that I use to take pictures:

https://github.com/sparkfun/SparkFun_HM … inoLibrary

Unfortunately, the “camera” sketch requires BSP version 1.2.1 which is not compatible with the BLE sketch requiring 2.0.5 and vice versa. I’ve never had to merge sketches running on different BSPs. Does anyone know how to go about this? Is it possible to copy certain folders from one BSP to the other?

Only including the line:

#include <ArduinoBLE.h>

Already throws the error on BSP 1.2.1:

In file included from C:\Users\jante\Documents\Arduino\libraries\ArduinoBLE\src/ArduinoBLE.h:26,
from C:\Users\jante\Documents\work\Arduino\Stop_Motion_Original\SparkFun_HM01B0_Camera_ArduinoLibrary-master\examples\Example1_StopMotion\Example1_StopMotion.ino:23:
C:\Users\jante\Documents\Arduino\libraries\ArduinoBLE\src/BLETypedCharacteristics.h:60:61: error: ‘word’ was not declared in this scope
class BLEWordCharacteristic : public BLETypedCharacteristic {
^~~~
C:\Users\jante\Documents\Arduino\libraries\ArduinoBLE\src/BLETypedCharacteristics.h:60:65: error: template argument 1 is invalid
class BLEWordCharacteristic : public BLETypedCharacteristic {
^
Bibliothek SparkFun_Himax_HM01B0_Camera in Version 0.0.3 im Ordner: C:\Users\jante\Documents\Arduino\libraries\SparkFun_Himax_HM01B0_Camera wird verwendet
Bibliothek ArduinoBLE in Version 1.1.3 im Ordner: C:\Users\jante\Documents\Arduino\libraries\ArduinoBLE wird verwendet
exit status 1
Fehler beim Kompilieren für das Board SparkFun Edge.

Thanks everyone, especially Paul for the help so far!