Page 1 of 2 12 LastLast
Results 1 to 20 of 22

Thread: numeric Broadcast Protocol NBP Devices

  1. #1
    Tuner
    Join Date
    Sep 2015
    Location
    OHIO
    Posts
    94

    numeric Broadcast Protocol NBP Devices

    Can you give us some examples of a device that could have NBP/SPP for use with TA? I have never heard of NBP, but I know there are bluetooth sampling boards that can be connected to temperature sensors, ignition sensors, etc. My engine doesn't have OBD, but I would like to record or display the engine RPM.

  2. #2
    HPT Employee Weston@HPTuners's Avatar
    Join Date
    Jul 2014
    Location
    39.735034, -103.894459
    Posts
    868
    This is a new protocol for 3rd party developers to be able to easily send data to apps like ours, without us having to devote resources to supporting a bunch of different products and protocols. We had been contacted a number of times over the years about us adding support for sensor data from various different products, and although I think many of those are cool products that I'd like to be able to support, the reality is that it's wildly impractical for us to spend our resources developing and then forever maintaining support for every different kind of product out there.

    The much more practical approach is to support and promote common protocols: NMEA-0183 for GPS, ELM327 for OBD polling (but beware of Chinese knockoffs!), and now NBP for everything else. The only time I want us to invest our resources into supporting one specific product is when it's something that our company sells (that is largely what funds our app, after all), and maybe certain very specific exceptions where there's a high value to having it in the app.

    At the present time, there is nothing commercially available for NBP just yet, but there is a tire temperature product in the works, and electronics hobbyist / DIY types could start using it for their projects as well. As a hobbyist type myself, I have various personal projects that use an Arduino and other components from places like SparkFun, and I'll be updating some of those to use NBP so that I can capture their data with TrackAddict.

    As more products and/or info becomes available, I'll try to keep the NBP section of our User Guide updated too.

  3. #3
    Potential Tuner
    Join Date
    Aug 2018
    Posts
    3
    I saw this yesterday and I am working on integrating it with a Raspberry Pi and canbus adapter to grab some GMLAN High speed bus stuff. Plan is to grab Steering wheel angle, ABS/TCM status, brake applied, etc.

    I have tested the connection from Pi->Race Render and can send NBP packets no problem. I'll push this to github when I get a chance to actually integrate it with the can logger scripts and test. I'll probably split out the python pynbp library for use by others.

  4. #4
    Potential Tuner
    Join Date
    Aug 2018
    Posts
    3
    https://github.com/tmkdev/pynbp - Python implementation of the NBP protocol. It's been tested once (on a raspberry pi 3) and it worked - it you use it let me know.

  5. #5
    Potential Tuner
    Join Date
    Jul 2018
    Posts
    1
    Sorry to ask for the fish but can you post a link to the ref doc etc about NBP that you used? I first heard of this protocol in the change list for the latest update of Track Addict, and a search led me to this thread...

  6. #6
    HPT Employee Weston@HPTuners's Avatar
    Join Date
    Jul 2014
    Location
    39.735034, -103.894459
    Posts
    868
    Quote Originally Posted by axelriet View Post
    Sorry to ask for the fish but can you post a link to the ref doc etc about NBP that you used? I first heard of this protocol in the change list for the latest update of Track Addict, and a search led me to this thread...
    Current compatibility info and developer docs here: http://racerender.com/TrackAddict/docs/Interop.html#NBP

  7. #7
    Potential Tuner
    Join Date
    Jun 2019
    Posts
    2
    I am building a capture tool for motorbikes and/or classic cars which don't have OBD ports.
    I have built a bluetooth elm327 emulator but it only seems to reach a maximum capture rate of 17hz with trackaddict on a galaxy s8.

    Can you advise if I can expect higher data rates with nbp and whether bluetooth or wifi would be fastest.

    Also would emulating an hptuners hp12 be faster?

    Basically what is the fastest comms protocol and can it achieve 100hz?

  8. #8
    HPT Employee Weston@HPTuners's Avatar
    Join Date
    Jul 2014
    Location
    39.735034, -103.894459
    Posts
    868
    Quote Originally Posted by Tune View Post
    I am building a capture tool for motorbikes and/or classic cars which don't have OBD ports.
    I have built a bluetooth elm327 emulator but it only seems to reach a maximum capture rate of 17hz with trackaddict on a galaxy s8.

    Can you advise if I can expect higher data rates with nbp and whether bluetooth or wifi would be fastest.

    Also would emulating an hptuners hp12 be faster?

    Basically what is the fastest comms protocol and can it achieve 100hz?
    17 Hz is fairly good for OBD polling over Bluetooth using the ELM protocol.

    Wireless latency issues are usually the biggest limiting factor, so your best bet would be to use NBP and just broadcast continuously, thereby avoiding the latency of sending requests and waiting for responses. At the present time, the app's CSV file logging may not be the greatest above 20 Hz, but there will be some future changes coming to help that, as we move to more functionality to using our more robust binary format (from which you can still export to CSV).

    WiFi should have more bandwidth than Bluetooth, but the setup process and user experience is more complicated, so Bluetooth SPP tends to be more practical. If using WiFi, the user needs to not only join the device's WiFi network, but on Android he also needs to also confirm that he wants to connect to it even though it doesn't have Internet connectivity, otherwise it will say it's connected but not actually be using it. This will likely block any Internet functionality as well. There's also a change coming to Android where it wont let apps like ours initiate WiFi scans very often, so it's likely the user will need to manually tell the phone to connect to the network.

  9. #9
    Potential Tuner
    Join Date
    Jun 2019
    Posts
    2
    Thanks for getting back to me. I have a dedicated phone for Trackaddict, an old galaxy s4, so the wifi should not be a problem. I've ordered some wifi dongles so I'll aee how I get on.

    If it won't handle 100hz my plan is to store the data locally on an sd card and send a seqence number to trackaddict which it can log. Then once the race is over I will merge the two spreadsheets together based on the sequence nos.

  10. #10
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Hi All does any one have any Arduino code so i could do some testing of the NBP protocol?

    Also does the device names eg Brake Pedal appear in the RAW data list?

  11. #11
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    @weston at HP

    Im using a ESP32 Arduino to do the connection too the TracK Addict App, and checking the received string on the mobile device using "serial Bluetooth Terminal" App.



    I have managed to pair the ESP32 with Track Addict App but the NBP TAB at the bottom is "Yellow" not green any ideas why?


    ESP32 code below


    #include "BluetoothSerial.h"

    BluetoothSerial serialBT;
    unsigned long tm;
    void setup() {
    Serial.begin(9600);
    String stringToSend = "";
    if(!serialBT.begin("Lotus")){
    Serial.println("An error occurred initializing Bluetooth");
    Serial.print("The device started, now you can pair it with bluetooth!");
    }
    }


    void loop() {
    tm = millis();
    serialBT.print("*NBP1, UPDATE,");
    serialBT.println((tm)*1.00);
    serialBT.print("Gear :");
    serialBT.println("3");
    serialBT.println("#");
    serialBT.write(13); // carriage return
    Serial.println(tm);
    //serialBT.println("@NAME:Test Device");
    delay (2000);
    }

  12. #12
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Quote Originally Posted by moth4017 View Post
    @weston at HP

    Im using a ESP32 Arduino to do the connection too the TracK Addict App, and checking the received string on the mobile device using "serial Bluetooth Terminal" App.



    I have managed to pair the ESP32 with Track Addict App but the NBP TAB at the bottom is "Yellow" not green any ideas why?


    ESP32 code below


    #include "BluetoothSerial.h"

    BluetoothSerial serialBT;
    unsigned long tm;
    void setup() {
    Serial.begin(9600);
    String stringToSend = "";
    if(!serialBT.begin("Lotus")){
    Serial.println("An error occurred initializing Bluetooth");
    Serial.print("The device started, now you can pair it with bluetooth!");
    }
    }


    void loop() {
    tm = millis();
    serialBT.print("*NBP1, UPDATE,");
    serialBT.println((tm)*1.00);
    serialBT.print("Gear :");
    serialBT.println("3");
    serialBT.println("#");
    serialBT.write(13); // carriage return
    Serial.println(tm);
    //serialBT.println("@NAME:Test Device");
    delay (2000);
    }



    OK mow we have a GREEN NBP this code below will display Gear 3 in Raw Data ..

    ESP32 code below


    #include "BluetoothSerial.h"

    BluetoothSerial serialBT;
    float tm;
    void setup() {
    Serial.begin(9600);
    if(!serialBT.begin("Lotus")){
    Serial.println("An error occurred initializing Bluetooth");
    Serial.print("The device started, now you can pair it with bluetooth!");
    }
    }


    void loop() {
    tm = millis();
    serialBT.print("*NBP1, UPDATE,");
    serialBT.println((tm)*1.00);
    serialBT.print("Gear");
    serialBT.println(":3");
    serialBT.println("#");
    Serial.println(tm);
    delay (2000);
    }

  13. #13
    Potential Tuner
    Join Date
    Sep 2020
    Posts
    1
    hey moth4017,
    thanks for sharing your code.
    I can't get to show a green nbp with your code.
    Can you think of any suggestion for me?

    Thanks,
    Guido

    Quote Originally Posted by moth4017 View Post
    OK mow we have a GREEN NBP this code below will display Gear 3 in Raw Data ..

    ESP32 code below


    #include "BluetoothSerial.h"

    BluetoothSerial serialBT;
    float tm;
    void setup() {
    Serial.begin(9600);
    if(!serialBT.begin("Lotus")){
    Serial.println("An error occurred initializing Bluetooth");
    Serial.print("The device started, now you can pair it with bluetooth!");
    }
    }


    void loop() {
    tm = millis();
    serialBT.print("*NBP1, UPDATE,");
    serialBT.println((tm)*1.00);
    serialBT.print("Gear");
    serialBT.println(":3");
    serialBT.println("#");
    Serial.println(tm);
    delay (2000);
    }

  14. #14
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Quote Originally Posted by guidout View Post
    hey moth4017,
    thanks for sharing your code.
    I can't get to show a green nbp with your code.
    Can you think of any suggestion for me?

    Thanks,
    Guido
    HI

    What colour is the NBP Tab, RED,or Yellow?

  15. #15
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Hi im having trouble with the WIFI version , i cart get it to connect to the NBP , has any one else been able to do this and share some code?

  16. #16
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    WifI version using esp32 (im not a programmer ) but it works

    //V1.001
    #include <WiFi.h>
    const char* ssid = "TrackAddict";
    const char* password = "12345678";
    unsigned long tm = 0;
    int i =0;

    //int ssid_hidden = 0; // 0 = broadcast 1 = hidden
    IPAddress ip(192, 168, 0, 29); // this works
    IPAddress gateway(192, 168, 0, 1);
    IPAddress subnet(255, 255, 255, 0);
    IPAddress dns(8,8,8,8);
    const int serverPort = 35000;
    WiFiServer server;
    WiFiClient client;


    void setup() {
    Serial.begin(9600);
    WiFi.mode(WIFI_AP);
    WiFi.softAP(ssid, password);
    delay(100);
    WiFi.softAPConfig(ip, gateway,subnet);
    server = WiFiServer(serverPort);
    server.begin();
    }

    void loop() {
    client = server.available(); //Listen for incoming clients

    if (client){ //If a new client connects,
    Serial.println("New Client."); //print a message out in the serial port

    while (client.connected()){
    Serial.println("Client connected.");
    Serial.println(client.available());
    for (i =1; i<7;i++){
    int gear = i;
    nbpDisplay();
    Serial.println (i);
    }

    for (i =1; i<7;i++){
    int gear = i;
    nbpDisplay();
    Serial.println (i);
    }
    }
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println();
    }
    }

    void nbpDisplay(){ //demo gear test
    tm=millis()/1000,2;
    client.print("*NBP1,UPDATE,");
    client.println(tm);
    client.print(""Gear"");
    client.print(":");
    client.println(i);
    client.println("#");
    Serial.println(tm);
    Serial.println (i);
    delay (100);
    }
    Last edited by moth4017; 10-22-2020 at 06:44 PM.

  17. #17
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Im now on the project i wanted to do some months ago , i have 3D printed some brackets for sensors to be fastened to the brake and the accelerator so they can be logged in track addict. im also looking at some aero sensors to log into track addict to check lift/down force ..

  18. #18
    Potential Tuner
    Join Date
    Oct 2020
    Posts
    3
    Hi Moth,

    Want to thank you for posting this code. It's been a help to kind of get me rolling. I have an ESP32 I am working with as well, trying to use it to log the CANBUS on my R53 Mini.

    Couple questions:

    -Have you encountered any performance/lag issues with the WIFI version? I have an LG G6 I am testing on and found that there is a delay between data showing up on the serial monitor and it showing up on the phone. I replaced the simulated gear you had with a simple counter and noticed a lot of stuttering on the HP Tuners display. I siplified the code a little bit just to try and make it easier for me to play with. I'll be the first to admit I am not a coder

    //V1.001
    #include <WiFi.h>
    const char* ssid = "TrackAddict";
    const char* password = "12345678";
    unsigned long tm = 0;
    int i =0;

    //int ssid_hidden = 0; // 0 = broadcast 1 = hidden
    IPAddress ip(192, 168, 0, 29); // this works
    IPAddress gateway(192, 168, 0, 1);
    IPAddress subnet(255, 255, 255, 0);
    IPAddress dns(8,8,8,8);
    const int serverPort = 35000;
    WiFiServer server;
    WiFiClient client;


    void setup() {
    Serial.begin(9600);
    WiFi.mode(WIFI_AP);
    WiFi.softAP(ssid, password);
    delay(100);
    WiFi.softAPConfig(ip, gateway,subnet);
    server = WiFiServer(serverPort);
    server.begin();
    }

    void loop() {
    client = server.available(); //Listen for incoming clients

    if (client){ //If a new client connects,
    Serial.println("New Client."); //print a message out in the serial port

    while (client.connected()){
    Serial.println("Client connected.");
    Serial.println(client.available());
    i = i+1;
    tm=millis()/1000,2;
    client.print("*NBP1,UPDATE,");
    client.println(tm);
    client.print("Gear");
    client.print(":");
    client.println(i);
    client.println("#");
    Serial.println(tm);
    Serial.println (i);
    delay (100);
    }


    }
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println();
    }


    -Can HP Tuner comment on how the app does the syncing with the NBP? Is it using the time stamp or is it just writing whatever piece of data is the most recent when it updates the log file?

    -Beyond tweaking the code did you have to make any tweaks to get the BT version working? I can get NBP to go yellow but not green. Whats interesting is I can see the data just fine in the serial terminal. I wonder if that is a limit of the G6 I am testing on.

    I have some stuff on Github here if you want to look

    https://github.com/CBlumini/ESP32-CAN-Transmiter

  19. #19
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Hi My aim is to use the ESP32 with built in Wifi and Blue tooth with its dedicated PCB and 4 inputs that will take up to 15V in put for power with filter protection.
    at the moment im getting around 60 readings a second with 2 inputs which is faster enough at the moment for the brake and accelartoe logging im doing on track testing.

    the issue im havin at the moment is the App is dropping connection after around 3 minutes and im waiting for a reply from Weston ( please) to try to work out what is happenig.
    Im using a samsung xcover 4 and have not experiensed any delay's, with either Bluetooth ot Wifi.

    Re Temperrature Sensing, i would use a 8 or 16 channel multiplexer and one thermo couple amplifier for all the K type thermocouples and just sample each one in turn as the temperature change does not happen that fast.

    Im looging at some sensing for lift and down force at the moment and hope to post some results on this too.. my car is ment to give me 85kg down force at 150KPh so will be interesting to see if it does..

    re 5V 12V with 3.3v input you can just use a voltage divide .. google it.

    Why use an esp32? well the A to D converters are 10/12 bit and the processor is Daul core and just it has a bit more horse power that the 8 bit versions plus it has built in Blue tooth and Wifi and they are fairly cheap from the big chinise super market.

  20. #20
    Tuner in Training
    Join Date
    Dec 2019
    Posts
    39
    Quote Originally Posted by Blumini509 View Post
    Hi Moth,

    Want to thank you for posting this code. It's been a help to kind of get me rolling. I have an ESP32 I am working with as well, trying to use it to log the CANBUS on my R53 Mini.

    Couple questions:

    -Have you encountered any performance/lag issues with the WIFI version? I have an LG G6 I am testing on and found that there is a delay between data showing up on the serial monitor and it showing up on the phone. I replaced the simulated gear you had with a simple counter and noticed a lot of stuttering on the HP Tuners display. I siplified the code a little bit just to try and make it easier for me to play with. I'll be the first to admit I am not a coder

    //V1.001
    #include <WiFi.h>
    const char* ssid = "TrackAddict";
    const char* password = "12345678";
    unsigned long tm = 0;
    int i =0;

    //int ssid_hidden = 0; // 0 = broadcast 1 = hidden
    IPAddress ip(192, 168, 0, 29); // this works
    IPAddress gateway(192, 168, 0, 1);
    IPAddress subnet(255, 255, 255, 0);
    IPAddress dns(8,8,8,8);
    const int serverPort = 35000;
    WiFiServer server;
    WiFiClient client;


    void setup() {
    Serial.begin(9600);
    WiFi.mode(WIFI_AP);
    WiFi.softAP(ssid, password);
    delay(100);
    WiFi.softAPConfig(ip, gateway,subnet);
    server = WiFiServer(serverPort);
    server.begin();
    }

    void loop() {
    client = server.available(); //Listen for incoming clients

    if (client){ //If a new client connects,
    Serial.println("New Client."); //print a message out in the serial port

    while (client.connected()){
    Serial.println("Client connected.");
    Serial.println(client.available());
    i = i+1;
    tm=millis()/1000,2;
    client.print("*NBP1,UPDATE,");
    client.println(tm);
    client.print("Gear");
    client.print(":");
    client.println(i);
    client.println("#");
    Serial.println(tm);
    Serial.println (i);
    delay (100);
    }


    }
    client.stop();
    Serial.println("Client disconnected.");
    Serial.println();
    }


    -Can HP Tuner comment on how the app does the syncing with the NBP? Is it using the time stamp or is it just writing whatever piece of data is the most recent when it updates the log file?

    -Beyond tweaking the code did you have to make any tweaks to get the BT version working? I can get NBP to go yellow but not green. Whats interesting is I can see the data just fine in the serial terminal. I wonder if that is a limit of the G6 I am testing on.

    I have some stuff on Github here if you want to look

    https://github.com/CBlumini/ESP32-CAN-Transmiter
    Hi the time stamp sent to the app is just to keep the updates in order.

    there may be a tweek in the Blue tooth version needed try this,

    #include "BluetoothSerial.h"

    BluetoothSerial serialBT;
    float tm;
    void setup() {
    Serial.begin(9600);
    if(!serialBT.begin("Lotus")){
    Serial.println("An error occurred initializing Bluetooth");
    Serial.print("The device started, now you can pair it with bluetooth!");
    }
    }


    void loop() {
    tm = millis();
    serialBT.print("*NBP1, UPDATE,");
    serialBT.println((tm)*1.00);
    serialBT.print(""Gear"");
    serialBT.print(":");
    serialBT.println("3");
    serialBT.println("#");
    Serial.println(tm);
    delay (2000);
    }

    for some reason this forum removes some of the code i post this line
    serialBT.print(""Gear""); should look like this serialBT.print gear.png
    Last edited by moth4017; 10-23-2020 at 04:03 PM.