How to update DK system firmware


#1

Hi to all,
I have my first DK Bluz and I need to update system firmware with a new one.
I don’t understanding if this is possible via air or without gateway shield.
Who can help me?
Best regards,

Michele.


#2

Welcome!

Your bluz DK shipped with new-ish firmware depending on when and where you ordered it from. Do you mean you want to upgrade the system firmware? As in 2.2.50 to 2.3.50?

If yes, then all you need to do is build your app with the version of firmware you would like. This can be selected under the Devices menu in the Particle Web IDE. When your app is then flashed to bluz, the system will automatically enter “Safe Mode” and update the system firmware for you.

You can read more about this process in our docs: http://docs.bluz.io/tutorials/updates/

Let me know if that helps.


#3

Hi Eric,
bluz DK firmware is 2.1.50 version.
I have tried to update firmware with last version from cloud but this doesn’t work.
Have you other suggestions for me?
Best regards,

Michele.


#4

Can you explain what steps you followed and the outcome of what you tried? This is the normal upgrade process and should work fine.

The only other way is to use a Serial converter and load it through the bootloader, or to use a JTAG programmer. OTA would be much simpler and require no additional hardware.


#5

Hi Eric,
I try to connect xbee receiver to Bluz DK via serial pin (TX,RX).
My goal is to receive data from xbee send data to Bluz DK and read data via bluetooth LE from IOS.
I have already try this with xBee—>particle Photon——>HM-10——>IOS and work fine but I prefer to use this configuration:

				**xBee—>Bluz DK—>IOS**

I don’ need cloud support because this application work without internet connection.
Can you help me?
Best regards,

Michele.

#6

How are you reading the data on iOS? Do you have your own custom app?

That sounds straight forward, you can use bluz in local communication mode to do that without the cloud. You can look to our docs for guidance: http://docs.bluz.io/tutorials/local_communication/

Are you having any specific issues? We would need more details on your particular problem before we could provide more help. Let me know


#7

Hi Eric,
this is a simple code I use to transfer data from serial port (RX,TX) of Particle Photon to HM-10 BLE:

 #include <ParticleSoftSerial.h>
 SYSTEM_MODE(SEMI_AUTOMATIC)

 #define SENDER   Serial1            // UART (RX,TX)
 #define RECEIVER SoftSer         // HM-10 BLE Bluetooth
 #define PROTOCOL SERIAL_8N1
 #define PSS_RX D2 
 #define PSS_TX D3


 #if (SYSTEM_VERSION >= 0x00060000)
  SerialLogHandler logHandler;
 #endif

// Constants
const uint32_t baud = 9600;
const size_t READ_BUF_SIZE = 128;
// Global variables
size_t readBufOffset = 0;
char readBuf[READ_BUF_SIZE];

ParticleSoftSerial SoftSer(PSS_RX, PSS_TX); 


void setup() {
  WiFi.off();
  Serial.begin();
  SENDER.begin(baud, PROTOCOL);   // baud rates below 1200 can't be produced by USART
  RECEIVER.begin(baud, PROTOCOL); // but SoftSerial can ;-)

  delay(3000);
  Serial.println("Setup terminated!");
  Time.zone(10);
}
void loop() {
  delay(50);
  sendData();
}

void sendData(void)
{
   
    while (SENDER.available())
    {
        if (readBufOffset < READ_BUF_SIZE)
        {
            char c = SENDER.read();
            if (c != '\n')
            {
                // Add character to buffer
                readBuf[readBufOffset++] = c;
            }
            else
            {
                // End of line character found, process line
                readBuf[readBufOffset] = 0;
                Serial.printlnf("Received from dataloggerTX: %s", readBuf);
                RECEIVER.printlnf("%s", readBuf);
                readBufOffset = 0;
            }
        }
        else
        {
            Serial.println("readBuf overflow, emptying buffer");
            readBufOffset = 0;
        }
    }
}

I need to do the same with BLUZ DK.
Thanks in advance,

Michele.


#8

bluz has only 1 Serial port, that is the biggest difference and probably your biggest hurdle. The Serial peripheral in your code looks to be for debugging, so that may not be necessary.

However, you are using the Soft Serial as well, bluz doesn’t support that. What do you need two Serial peripherals for? Is it possible to hook up these devices differently so you would only need one Serial?


#9

Hi Eric
I use two serial because receive data from serial1 of photon and send same data to ble device via softserial.
Now obviously I need only one serial port (serial1) to receive data and I need to send same data via ble to my device (iOS in this case).
My question is:
How I can send data to my iOS device via Bluetooth?
Have you a piece of code do that?
Thanks in advance,

  Michele.

#10

@eric I have a BluzDK on 1.1.47 and I am trying to flash a basic handshake sketch example to it and get the firmware upgraded 2.3.50. The IDE message is as follows:

The documentation is not clear on how long this takes (magenta flashes) - eventually the pop-up window changed to ‘upgrade done’ and I refreshed the IDE devices view - this then showed 2.2.50 on the device? Could you help explain what happened here?


#11

@michele.lazzarato: What are you trying to get it to on your iOS device? Do you have your own app? You could use the iPhone as a gateway without own app and then access data through try cloud. But what is actually listening for data on the iPhone?

@armor: There was a breaking change when upgrading from 1 to 2. Basically, we resized the firmware files to give the user more flash for their own code, growing that space from 20K to 36k.

This would have broken upgrades, and so instead we had to put a special procedure in place when upgrading from 1 to 2. This simply updated your system version first, which is the opposite of how it usually works. That should have taken a few minutes depending on what gateway you were using.


#12

Hi Eric,
yes on IOS I have my own app that work fine with HM-10 bluetooth device connected to particle photon.
I send data from photon to HM-10 via serial protocol and IOS app receive data via bluetooth.
Is possible to do this with Bluz DK only?
If yes can you send me wich command i need to use for Bluetooth?
Thanks,
Michele.


#13

Yes, this is possible. I don’t had a specific example, but you can look at our open source iOS app for the code to communicate with bluz: https://github.com/bluzDK/iOS-app

You can easily use that an utilize local communication. Let me know if that helps or if you still have questions.


#14

Hi Eric,
I have already IOS app thats work fine.
Is This the right command to send data via bluetooth to my IOS app?

// Send a three byte array of data
uint8_t data[3] = {0x01, 0x02, 0x03};
BLE.sendData(data, sizeof(data));

BLE.registerNotifications(radioCallbackHandler);

Thanks,
michele.


#15

Yes, that will send data to your iOS app. If you want to setup bluz to receive data, you need to register a handler to the data callback as well: http://docs.bluz.io/reference/ble/#registerdatacallback