Possibly damaged two Nano 33 BLE's trying to connect to app

Fan_Control_9.aia (216.2 KB)
FanControl9.ino (6.8 KB)

Same results with #9, does not increment on the app or the serial monitor. It did get rid of the [ and ] but the " is still present for the first and last value. Looks like this

"10
11
12
13"

Hmm - I tested the modifications here (without Bluetooth) and they worked. Will be something subtle. Link up again in a week's time?

Fan_Control_10.aia (216.2 KB)
FanControl10.ino (6.9 KB)

That seems to work sort of. The numbers are incrementing by 4 except fan speed increments by a huge number and all numbers are huge. Below is the start of the serial print out. It starts with rad temp of 618 instead of 10? The output of the app is the same as the serial output.

22:24:06.455 -> Rad Level % is now: 618
22:24:06.455 -> Cnd Level % is now: 619
22:24:06.455 -> Aux Level % is now: 620
22:24:06.455 -> Fan Speed is now: 208825
22:24:16.443 -> Rad Level % is now: 622
22:24:16.443 -> Cnd Level % is now: 623
22:24:16.443 -> Aux Level % is now: 624
22:24:16.443 -> Fan Speed is now: 218830
22:24:16.443 -> Rad Level % is now: 626
22:24:16.443 -> Cnd Level % is now: 627
22:24:16.443 -> Aux Level % is now: 628
22:24:16.443 -> Fan Speed is now: 218831
22:24:26.478 -> Rad Level % is now: 630
22:24:26.478 -> Cnd Level % is now: 631
22:24:26.478 -> Aux Level % is now: 632
22:24:26.478 -> Fan Speed is now: 228836

I think I figured out why the numbers are high. I think the sketch was running for a while before I turned on the serial monitor. But that doesn't explain the fan speed.

Yes that's it. When I open the serial monitor before the app connects rad temp starts at the correct number and increments perfectly. But fan speed starts ok, but does not incrementing correctly.

22:43:42.091 -> Connected to central: 5b:ca:2d:16:24:6e
22:43:42.091 -> Rad Level % is now: 10
22:43:42.091 -> Cnd Level % is now: 11
22:43:42.091 -> Aux Level % is now: 12
22:43:42.091 -> Fan Speed is now: 13
22:43:42.091 -> Rad Level % is now: 14
22:43:42.091 -> Cnd Level % is now: 15
22:43:42.091 -> Aux Level % is now: 16
22:43:42.091 -> Fan Speed is now: 123068
22:43:52.126 -> Rad Level % is now: 18
22:43:52.126 -> Cnd Level % is now: 19
22:43:52.126 -> Aux Level % is now: 20
22:43:52.126 -> Fan Speed is now: 133073
22:44:02.115 -> Rad Level % is now: 22
22:44:02.115 -> Cnd Level % is now: 23
22:44:02.115 -> Aux Level % is now: 24

Well that's good :joy:

.... and that is very strange :thinking: Though of course these are fake values anyway, just to get the comms correct.

IgSensorVal is declared as an array of length 3, that is index 0..2, so FanSpeed index 3 is outside this array. Hope this will make it work

I spotted that Rolf but thank you for pointing it out - what is strange is that the correct value for index 3 was reported on first iteration of the loop! Would be nice if the Arduino IDE could pick-up typos of that ilk but it is pretty basic really.

Not to familiar with C or Arduino language, but I understood int igSensorVal[3]; to include [0] to [3] not so. I have an hour or so to give it a try.

Thanks

@rkl099 @ChrisWard

All works perfectly with igSensorVal[4].

This is both on the serial monitor and the app.

Thanks guys. I will be out of town for about a week. Last time I went out of town for a week, 3 BLE's that appeared to be dead started working. Be interesting to see if the dead one I have here starts working. Stay tuned and Thank You.

07:51:39.571 -> Connected to central: 78:ef:94:a9:61:c4
07:51:39.571 -> Rad Level % is now: 10
07:51:39.571 -> Cnd Level % is now: 11
07:51:39.571 -> Aux Level % is now: 12
07:51:39.571 -> Fan Speed is now: 13
07:51:49.562 -> Rad Level % is now: 14
07:51:49.562 -> Cnd Level % is now: 15
07:51:49.562 -> Aux Level % is now: 16
07:51:49.562 -> Fan Speed is now: 17
07:51:59.575 -> Rad Level % is now: 18
07:51:59.575 -> Cnd Level % is now: 19
07:51:59.575 -> Aux Level % is now: 20
07:51:59.575 -> Fan Speed is now: 21
07:52:09.581 -> Rad Level % is now: 22
07:52:09.581 -> Cnd Level % is now: 23
07:52:09.581 -> Aux Level % is now: 24
07:52:09.581 -> Fan Speed is now: 25
07:52:19.570 -> Rad Level % is now: 26
07:52:19.570 -> Cnd Level % is now: 27
07:52:19.570 -> Aux Level % is now: 28
07:52:19.570 -> Fan Speed is now: 29
07:52:29.606 -> Rad Level % is now: 30
07:52:29.606 -> Cnd Level % is now: 31
07:52:29.606 -> Aux Level % is now: 32
07:52:29.606 -> Fan Speed is now: 33
07:52:39.587 -> Rad Level % is now: 34
07:52:39.587 -> Cnd Level % is now: 35
07:52:39.587 -> Aux Level % is now: 36
07:52:39.587 -> Fan Speed is now: 37

Of course, all we have achieved is to send fake values :joy:

I'm concerned about the reliability of those boards. Considering their purpose, they need to be robust and reliable. You don't think you have got a bad batch?

The box for the board is probably going to need it's own cooling fan.

True but that has been the big problem. The current setup works fine without any board cooling fan. I just got back from FL with 100° F heat. The board only drives a 10ma PWM signal. No issues so far except I was limited to the Light Blue software which was very awkward to use.

OK so I am back after delivering two truckloads, 20,000 Lb of machines from NC to CT.

And guess what, the BLE that was dead when I left is now up and functioning again after a weeks rest. That's the same thing that happened in the beginning when I had three boards not working. It sort of like some capacitor on the board got charged up incorrectly and had to settle over a week. So back to having two BLE's to test with. This sort of answers the original question about damaged BLE's. Apparently there are certain thing that can be done with code to make a BLE unable to connect, but fixable when they set disconnected for a bit.

So I am having difficulty understanding the way the Fan_Control_10 works. If you could provide some explanation of whats was required to get the 4 values to show up independently that would be a big help.

Also Fan_Control_10 as well as some of the previous versions form about 6 and up will connect with LightBlue but wont display any meaningful data. I was wondering if they are doing something that is non-standard here.

So at this point Fan_Control_10 works with the fake values we have been sending it. Now for real values.

The attached code works well using LightBlue software but will need to be modified to work with Fan_Control_10. This is the software that is installed in the car now.

PWM_Fan_for_Nano_With_WDT_and_BLE.ino (22.1 KB)

A leap into the dark unknown:

Fan_Control_11.aia (216.2 KB)
FanControl11.ino (5.7 KB)

I'm away for four days, Friday-to-Monday inc, and only available sporadically between now and then.

Hi John

PWM_Fan_for_Nano_With_WDT_and_BLE.ino

I can't get that Sketch to compile!

It fails on all sorts of errors with nRF52_MBED_Slow_PWM.h and it's included files. Can you upload yours?

nRF52_MBED_Slow_PWM.h
nRF52_MBED_Slow_PWM.hpp
nRF52_MBED_Slow_PWM_Impl.h
nRF52_MBED_Slow_PWM_ISR.h
nRF52_MBED_Slow_PWM_ISR.hpp
nRF52_MBED_Slow_PWM_ISR_Impl.h
PWM_Generic_Debug.h

No problem uploading here. Did you install the "nRF52_MBED_Slow_PWM.h" library. It also has a watchdog timer that will require you to do a factory reset (double button press) on the board if it trips, as well as resting the com ports after you reset and again after you complete the upload.

// To be included only in main(), .ino with setup() to avoid `Multiple Definitions` Linker Error
#include "nRF52_MBED_Slow_PWM.h"     // https://github.com/khoih-prog/nRF52_MBED_Slow_PWM
#include <ArduinoBLE.h>

Fan_Control_11.aia does not show the app in the list of BLE devices.

However using FanControl11.ino with Fan_Control_10.aia works.

I can up load it, but it does not Compile. Given that the developer has archived the files, it's possible that your copy of them are in better shape.