Author Topic: Update Firmwae  (Read 5833 times)

0 Members and 1 Guest are viewing this topic.

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Update Firmwae
« on: December 22, 2018, 04:59:03 am »
Hi,
i'm developing a mesh with some routers and end devices using LWmesh stack.. i would like to upgrade the firmware of routers through OTA.. i'm not familiar with OTA.. can anyone help me to use OTA? how to program the routers for OTA upgrade and how to perform the OTA ??
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Update Firmwae
« Reply #1 on: December 22, 2018, 05:10:13 am »
If your developing the routers, then that means cooking up a bootloader or adapting one to suit your purpose,

Its a bit of code that sits on your device, generally stores the updated flash image somewhere on your device, loads the flash memory programming code to memory and reflashes the program memory with the updated image,

Fancy additions are things like fallback program images. or fallover methods to load the program to the device if an image was corrupted.

And finally to complete the picture is a function to update the bootloader while the device is running.
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #2 on: December 22, 2018, 05:16:18 am »
If your developing the routers, then that means cooking up a bootloader or adapting one to suit your purpose,
so it means when i program a router device , first i have to make it booloaded,is it?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #3 on: December 22, 2018, 05:20:04 am »
You can program multiple images into the device - one is a bootloader, the other one is an application. Or you can combine them externally.

Actually creating an OTA implementation is a big topic far outside of what can be described in a forum post. Start by creating code to transfer large files. Then add code for storing those files in the memory, etc.

LwMesh v1.1.1 included OTA example. You can look at that code, but be warned, it is not a plug and play thing, you will actually have to think and write code. Here is the link to the release https://www.dropbox.com/s/n6jwnj7otrioa4p/lightweight_mesh_stack_v1.1.1.zip?dl=0
« Last Edit: December 22, 2018, 05:23:45 am by ataradov »
Alex
 
The following users thanked this post: spec

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #4 on: December 22, 2018, 05:28:59 am »

LwMesh v1.1.1 included OTA example. You can look at that code, but be warned, it is not a plug and play thing, you will actually have to think and write code. Here is the link to the release
i'm using LwMesh v1.2.1...it has no OTA example.. then how can i use OTA?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #5 on: December 22, 2018, 05:30:26 am »
You can look at how it is done in the old one, copy some files, see what is necessary to make it work in v1.2.1. You know, actual software development work.

As I said, it is probably not going to be very useful as is, you can look at it for an idea.

You at first need to decide what will be the source of the update firmware and what type of architecture you want for your system.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #6 on: December 22, 2018, 05:43:12 am »
You at first need to decide what will be the source of the update firmware and what type of architecture you want for your system.
I have one coordinator and 30+routers places in corridors... i have to upgrade those routers using OTA if any change in the router code..
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #7 on: December 22, 2018, 05:44:50 am »
I have one coordinator and 30+routers places in corridors... i have to upgrade those routers using OTA if any change in the router code..
Good, then the code in the archive will be very close to what you want. It is architected to be a firmware push from a source device (coordinator).
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #8 on: December 22, 2018, 06:21:30 am »
Good, then the code in the archive will be very close to what you want. It is architected to be a firmware push from a source device (coordinator).
so it means i can use the coordinator as the OTA server.. is it? or does i need another device as OTA server
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #9 on: December 22, 2018, 06:22:40 am »
Yes, you can. You are the developer, you can do whatever you want. That's the magic of programming.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #10 on: December 26, 2018, 04:16:31 am »
What are the main difference in LwMesh1_2_1 and LwMesh1_1_1 versions? Is it only the OTA ? if i'm developing OTA with the LwMesh1_2_1 version, where i need to change the code? can i use the OTAServerDemo Application in the LwMesh1_1_1 version in LwMesh1_2_1 ? i'm successfully completed the OTA with LwMesh1_1_1, but stucked with LwMesh1_2_1 version... Please help me 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #11 on: December 26, 2018, 04:28:15 am »
I don't remember what the differences are. What specific problems are you having?

You need to change the code based on what compiler tells you in the error messages.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #12 on: January 07, 2019, 05:36:56 am »
hi,
 i'm using LwMesh1_2_1 version and i want to use the OTA upgrade in this.. is it possible to use the bootloader version from 1_1_1 version and load 1_2_1 version for my purpose?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #13 on: January 07, 2019, 05:38:20 am »
Yes, bootloader is independent. Versions are just numbers. Look at the actual code, and see what will and will not work.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #14 on: January 18, 2019, 05:27:23 am »
hi,
Using OTA upgrade , can we upgrade more than one device at a time?
« Last Edit: January 18, 2019, 05:29:21 am by Peili »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #15 on: January 18, 2019, 05:33:16 am »
Not with this implementation. But you can extend it to support more than one client. You would need to have an array of OtaServer_t structures, and corresponding logic. It should be fairly simple to implement.

But it is kind of pointless, since the bottle neck is the server throughput, so you will not get any speed advantage.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #16 on: January 18, 2019, 05:45:19 am »
doing with the OTA upgrade i'm facing some issues..
"Error: response timeout" is getting when i tried to upgrade it
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #17 on: January 18, 2019, 05:46:50 am »
DEBUG! Seriously, I can't teach you how to write software in this thread. Start from the message and follow things back to the source of the error, an then eliminate whatever the problem is.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #18 on: March 06, 2019, 07:46:29 am »
Hi,
I'm planning to program multiple devices via USB sequentially. I have developed a board, which can hold upto 6 devices at a time but, data connection to only one  and once the firmware update has done data pins automatically switches to the next. Now the problem is i need to program the boot loader one by one.
 Is it possible to load BOOTLOADER via com port?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #19 on: March 06, 2019, 07:49:24 am »
If device does not already have a bootloader of some sort that would listen on a COM port, then it is impossible to load a new bootloader. Only a programmer will help. This is sort of common sense.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #20 on: March 31, 2019, 05:21:39 am »
hi,
i successfully upload the boot loader image and my terminal shows 'C'.. and send file with xmodem.. Now i'm trying to upgrade it through OTA... program the OTAserver and tried to upload the new image.. But i'm getting error like
Code: [Select]
-> UART_COMMAND_COMM_CHECK
U






STATus
128
Status Here <- APP_UART_STATUS_CONFIRMATION
U






STATus
129
Status Here <- APP_UART_STATUS_PASSED
 * Comm check passed
After Communication Check
-> UART_COMMAND_START_REQUEST
U






STATus
128
Status Here <- APP_UART_STATUS_CONFIRMATION



U



<


STATus
4
Error: unexpected status (OTA_NO_RESPONSE_STATUS)
What will be the reason for it?please help
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #21 on: March 31, 2019, 05:26:02 am »
Your client does not respond. Check that you have specified the correct address and other network parameters. And that you actually have another device in the network running the OTA client.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #22 on: March 31, 2019, 05:40:05 am »
And that you actually have another device in the network running the OTA client.
What you mean by another device ?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Update Firmwae
« Reply #23 on: March 31, 2019, 05:41:20 am »
What are you updating over the air? Server contacts a client (which address you specify in the command line) and uploads the firmware remotely.
Alex
 

Offline PeiliTopic starter

  • Regular Contributor
  • *
  • Posts: 108
  • Country: in
Re: Update Firmwae
« Reply #24 on: March 31, 2019, 05:43:16 am »
What are you updating over the air?
i'm updating the Wsndemo.bin through the over the air.. Specified the last address i gave to the client when program it through serial interface. Does the OTAserver need bootloader?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf