We have upgraded the community system as part of the upgrade a password reset is required for all users before login in.

How to load custom firmware in large numbers of Omega2



  • I have to load my custom firmware into a large number of Omega2+ based devices, loading this via the ethernet expansion will take me days, is there any other method to "mass load" the Omega2+?



  • @Wing-Lok Omega2 or Omega2S? The latter has a separate flash supply pin to power only the SPI flash chip, but not the SoC, which allows programming the SPI flash chip if you have a suitable in-circuit SPI programmer for that (I did that once for debugging purposes using a borrowed Segger programmer).
    I don't know if it's possible to in-circuit program the flash on the Omega2, maybe there's a way to keep the SoC reset with high-impedance SPI pins (but SPI_CS0 active), but I doubt it.

    I do the firmware deployment for my custom firmware devices (~1000 in the field so far) via ethernet. This is possible without any manual interaction except connecting power and ethernet, and then waiting.

    The key is that the factory firmware of the Omega2(S) has IPv6 running on the ethernet by default, with a link local address derived from the Omega2's MAC. And as IPv6 easily allows to discover device's IPv6 on the local link (e.g. ping6 ff02::1%en7), a simple bash script can find the devices, send firmware via scp, and launch sysupgrade via ssh. This can also be parallelized to program multiple devices at the same time (with more than one ethernet dock, or with devices that have ethernet built-in like mine do).

    Hope this helps!



  • Thanks @luz you give me a lot to think about. I am using Omega2S+ and my custom board doesn't have an ethernet port. Due to my form factor I don't want to add an ethernet connection but I was considering adding a non-standard plug and make some custom tails so i can plug a temporary RJ45. Thanks for the tip on the ipv6.

    WL



  • @luz Hi,
    I have similar requirement.

    1. I have written a python script and installed lot of packages on omega2S+ to run this script. I want to create a firmware with this all packages pre-installed and also the python script. So on any new omega2s+ chip i just need to flash this customized firmware and its should be ready for play. How i can do this ?

    2. How i can flash the above customized firmware on multiple omega2s+. Any kind of batch or gang programming options.

    Thanks and Regards
    Suman Kumar



  • @Suman-kumar-Jha As @luz stated, you can connect via ssh on ipv6 also scp the files to each device. I have a custom board using Omega2S+, I added an RJ45 for ethernet so I can flash the devices as @luz suggested. I built a Linux app to do the work in automatically. It's not trivial but depending on your skills you could build something to do the same.



  • Thanks @crispyoz

    Can you help me in detail. If you can share any document or process manual to make this, it will be great help. I can learn from that and make my own app similar to yours. I am beginner in linux but very much interested to do.

    Kindly help and guide me.
    I am making a product in which i have omega2s+

    Regards Suman



  • @Suman-kumar-Jha The first thing you need to do is understand that ipv6 is nothing special it's generally the same as ipv4 but uses a different numeric system (noone bash me please I am keeping this simple). So if you can can use SSH to connect to an Omega device over ipv4 you can connect to it via ipv6 if you know the correct ipv6 address. If you look at your Omega when connected via serial terminal, type ifconfig and look at the ipv6 address associated with each interface, then look at the MAC address printed on the label on the SOC, you will see there is a correlation.

    Based upon this information you can manually SSH to the device using ipv6, if your ssh client supports ipv6 and you are connected on the same LAN. I use ethernet as I mentioned.

    Once you have established how you can connect via SSH, then SCP is easy.

    You don't need to know about linux in order to write a suitable script, you could also write something on windows using a powershell script. You don't need an app, my requirements are more complicated than just flashing devices and I'm not great at scripting so I tend to just write an app.

    Good luck.



  • @crispyoz Thanks for your support. I will try this.

    Can you help me on my first question

    I have written a python script and installed lot of packages on omega2S+ to run this script. I want to create a firmware with this all packages pre-installed and also the python script. So on any new omega2s+ chip i just need to flash this customized firmware and its should be ready for play. How i can do this ?

    Regards
    Suman



  • @Suman-kumar-Jha Without knowing any specifics, generally the answer is yes.
    My own custom firmware installs some hotplug scripts so the first time apcli0 comes up (when the user connects to their home wifi) , the script downloads the current release of my software and associated supporting files, configures some "stuff" then starts my custom daemon and BAM! you have a beautiful IoT device.



  • @crispyoz I am thinking to create single firmware file, which will be nothing but default omega firmware with all my other packages and a python script ready to run on boot. So if i flash this firmware on new omega chip. The omega will be ready to run. No further any download or configuration required. This is what i want.

    I made omega to run python script on boot and it is working good. It is sending received JSON data through MQTT protocol.



  • @Suman-kumar-Jha What your firmware does is up to you, but I suggest you keep in mind that today you flash some devices, you sell them, when a user actually starts using the device may be a little later and in that time you may have found some issue(s) in your software/script(s)/fimrware, so it is pretty important to ensure you have a method to update your firmware.

    How yo udo this was answered by @luz and my earlier explanation.

    If you oanly have a few devices, use the serial terminal, use wifisetup to connect to your local wifi, use scp to transfer your custom firmware into /tmp then using the serial console cd /tmp then sysupgrade -n <custom firmaware file name>

    These are not 5 minute solutions, youi'll need to spend some time to explore our suggested solutions and see what works best for you. Or you could purchase in incircuit prgramming device as @Luz suggested but you'll need some deep pockets.



  • @crispyoz No, customer is not going to do any change or update. Its not a development board that we are making for customer.

    We are making a product which is in final stage. So i am designing testing and programming fixture which will be used in manufacturing process. So for making programming jig i need help from omega team.

    I guess now its clear for you.



  • That is just a side issue. Your main question has been answered, you'll now need to make it work. BTW there is an article on mass deploying of OpenWRT, I haven't tried it on Omega and it is reliant on having an ethernet connection.
    https://lauri.võsandi.com/2017/09/lede-mass-deployment.html



  • @Suman-kumar-Jha if you are creating a fixture for the manufacturing process, then you could include a ethernet connection into the fixture. As I wrote above, if you have ethernet, you can flash custom firmware images without manual steps except connecting ethernet and power.

    Here's my bash script that can find and flash factory-state Omega2(S)(+) on an ethernet network segment: omega2flash.sh.
    The script is quite q&d, and only programs one omega at a time as-is (but it could be extended easily to flash multiple devices, contributions are welcome).



  • @luz Thanks for your support. Its a great help, i can learn from this and modify for my use. Further more i will update on github and omega community



  • @luz I tried to understand the script. I am making a testing fixture with raspberry pi 3 as host system, where i want to run script similar to yours one. And firmware file will be inside root directory
    In your script can you explain how i can bring firmware file.

    omega2flash <eth0> <auto|wait|omega2_ipv6|list|ping> [</root/Omega2SP_Custom.bin> [<uboot-env-file>]]

    Is above method is correct ?


Log in to reply
 

Looks like your connection to Community was lost, please wait while we try to reconnect.