How to load custom firmware in large numbers of Omega2
I have similar requirement.
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 ?
How i can flash the above customized firmware on multiple omega2s+. Any kind of batch or gang programming options.
Thanks and Regards
@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.
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+
@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.
@crispyoz Thanks for your support. I will try this.
Can you help me on my first question
@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.
luz last edited by
@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 ?