-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identifying devices #25
Comments
That's an idea I also proposed originally. If you program the CM4 modules using CMIO boards (and not in the final device), you do can put jumpers on the GPIO header to signal to the server which provisioning board it is. |
Thanks for your prompt response, @maxnet. We find cmprovision particularly beneficial as it allows us to:
Given these benefits, we believe that cmprovision's users who are looking to automate the flashing process wouldn't mind more intricate setups, such as acquiring the knowledge to operate and configure a managed switch. For our purposes, we're willing to explore this option if there aren't simpler alternatives. Unfortunately, configuring our devices post-assembly implies your suggestion may not be suitable for us. We've pondered other possibilities, although we're uncertain about their feasibility of implementation:
I'm curious, would there be a way to trigger LED blinking through a button on the cmprovision dashboard or website? It could be a valuable function to consider. Let me know your thoughts on these suggestions. Thanks in advance for your time and insights. |
Most simple alternatives comes with other down sides. E.g. I am aware that another user attaches USB sticks that have a label (1,2,3,4, etc) to the device being provisioned. Works in principle, but only when network booting fresh CM4 modules. |
Can you be clear what it is you are trying to achieve here? CMProvision was written by @maxnet under my request to create a thing we needed at the time to program CM3/4 devices quickly and efficiently. We have a setup with a handful of CMIO4 boards and a Raspberry PI for the server, the process is:
If you need to do something different here (for example flash a different LED or communicate with the server or even some other piece of hardware to say 'I'm finished, please box me') this just needs a small change to the script that is being executed... Maybe you just need the ability to edit the execution script? Gordon |
Think the topic starter does not want to use CMIO boards as an intermediate step, but wants to insert the CM4 module into the final device right away, program that, and stick a label on the final device. |
Ah haven't though about this. The USB stick approach seems straightforward and worth considering.
@ghollingworth I appreciate you sharing your process in detail. As @maxnet accurately pointed out, we're looking into the possibility of flashing the final device directly using cmprovision. This is mainly to streamline our device assembly, which could then be easily outsourced. Currently, flashing the CM4 is a technical step in the assembly process; eliminating it simplifies the task to merely piecing the parts together. Ideally, our workflow would look like this:
The main challenge here arises when steps 1-3 are executed simultaneously for multiple devices. Identifying which device has been assigned which serial number, and therefore which label, becomes difficult. We're seeking a way to address this issue. Please let me know if you have any further suggestions. Thanks again for your insights and assistance! |
Do you have any method of communicating directly with the operator from the device? i.e. a local display, an HDMI display (or a miniature USB-connected display) Otherwise, you could write a script to talk to a managed switch from the device and run that at the end of provisioning... |
In case the USB sticks do not work out: I added some minimal support for querying the port numbers of managed Ethernet switches that support SNMP v2 + BRIDGE-MIB. Still need to make some proper configuration option for it in the web interface (and add some documentation), but for now you can try out 1.6.4 from attached .zip and configure it from console like this: It will show right away if it can query the currently connected MAC addresses and port names. Can change the port names to your liking in the configuration of your switch on most brands. (it queries ifAlias if it exists, otherwise the standard ifName of the port is used). The functionality has been tested on Juniper, HP, MikroTik and Cisco switches, and should work on others, but can naturally not make any guarantees in regards to compatibility with every device on the market. |
This is great @maxnet 👏 ! Last Friday I was able to get the USB-stick solution to work, which I was already pretty happy with, but now I feel I should definitely try this out! As I'm writing this message I'm looking for a switch that supports SNMP BRIDGE-MIB. Currently looking at the Cisco Business 250 Series. The spec sheet states it supports Secondly: Looking at the changes you made, it seems that the port number of the switch is used as the provisioning_board name. Is that how we can identify the the attached devices? |
We only support the first. If you were dividing your switch ports into multiple VLANs, for example a VLAN of switch ports with Internet connectivity, and an isolated VLAN for stuff that should only be accessible in private network, and had a need to know the MAC tables of all the different VLANs than Q-BRIDGE would need to be used. But that is overkill for this purpose, so not implemented. Do be aware that Cisco switches tend to be the most difficult to setup. |
"provisioning_board" is just what the field is called in our internal SQLite database, that keeps the bookkeeping. The port name will be made available as $provisionboard in the label template. |
Yesterday I received the switch I ordered (a TP-LINK TL-SG2008) and tested out the new functionality. Everything worked flawlessly. To ensure consistency, I configured a static IP for the switch. I also modified the I was able to successfully provision 7 cm4's in paralel which was really cool to see 😎 . Here's a screenshot from an internal video I made to share with the team: Having experimented with both the USB stick and switch port approaches and reflecting which method provides us with best solution, we're leaning towards the former. Initially I thought not having to plug in an extra thumb drive would speed up the process, but I already noticed that the complexity of the network wiring can make it difficult to track the physical port connections. Additionally, our cmprovision frontend computer is located a few meters away from the flashing station, creating a challenge in port-to-device identification. With a USB stick attached to each device, I can unplug it from power and Ethernet, bring it back to the computer, and still be able identify the device. Conversely, using the switch port method, once the device is disconnected from the switch, I would have to remember the port number, which could be challenging if any interruption occurs. The USB stick method also eliminates the need to trace each network cable back to its port. Having said that I still feel this is a really cool solution. Others might not have the same concerns as me, perhaps by having better cable-management 😅. Thanks again for your efforts @maxnet. With this tool we just improved our assembly process by at least a factor of 3 💪 |
Thanks for the suggestions. I'll give it some more thoughts. We currently don't use the printer functionality, so all labels are pre-printed. The past devices I flashed I brought back to my desk and screen where I grabbed the label that matched the serial-number on the screen and sticked it to the device. The printer we use is a Brother PT-P900W. I already checked if it would be easy to interface with this printer, but the support is pretty lacking. It should be possible but it has certain limitations and currently not worth the extra engineering effort. |
I believe it supports ESC/POS language... |
Sorry, didn't mean to close... |
If it does not support any template friendly printing language, you can also look if it has a CUPS driver that can print arbitrary raster images. If it has CUPS support, and you only want simple 2D barcodes, a trick is to let cmprovision produce HTML with a barcode font, and pipe that to dompdf and lpr (lpr takes pdf files as input, if you do NOT specify the "-o raw" option, which you do would specify if you want to print jscript/zpl). Template would look like:
Another cmprovision user does a similar trick to print other supporting paperwork. |
When you ran (Like in the screenshot I posted earlier in: #25 (comment) ) |
If you connect the device being provisioned, and re-run the command, it does show a second entry in the "Mac -> interface name/alias table" ? Are you sure the entries in the "last 100 provisioning log entries" are from AFTER you enabled the Ethernet switch integration? |
Looks strange to me. |
I have reset the TL-SG2008 switch to factory defaults, assigned a static IP for the switch and reconfigured SNMP community name. After these adjustments, it started working as expected. Additionally, I ordered another switch from Tenda TEG5328F, which also worked seamlessly. Thank you @maxnet |
Can we get a proper tagged release including the SNMP switch integration? |
looking forward to snmp mib-bridge integration |
How does one keep track of which device is which when hooking it up with the switch. If you only hook up 1 device at at time this is easy of-course, but how does it work if you have a 16 port switch and you connect 15 devices. If a labels is printed after each successful flash you wouldn't know for which hooked up cm4 it is intended.
One possible solution I could think of is using a managed switch that has support for a MAC Address Table. You could lookup which mac address is hooked up to which port in the switch.
Interested to learn what strategies others are deploying.
The text was updated successfully, but these errors were encountered: