-
Notifications
You must be signed in to change notification settings - Fork 308
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
Support for other devices than a Raspberry Pi #646
Comments
Same here but for a Mac Mini. I was working my way through the "Getting Started" a few minutes ago when I decided to check the issues list for existing questions on that topic. I wouldn't mind tweaking the generated configuration manually if I didn't have to do this line-by-line in trial & error mode. |
I'll split this into two parts. First, In my own case, I've built bare-metal systems starting from:
followed by:
That all worked. If any remaining There may be scripts out there that assume I agree that the basic setup - requirements documentation still implies that Second, the issue with devices. This is a lot more tricky. The IOTstack menu is not "smart". It's basically a concatenation engine with a bit of string substitution for passwords, plus a special case for Node-RED which is, itself, a concatenation engine with a bit of list substitution. In IOTstack, most of the "hard work" gets done, by hand, long before the menu gets involved. Adding a new container means searching the web and studying existing
With the foregoing as background, the problem with devices needs to be split into two parts. First, there are containers like Node-RED where the service definition includes a standard set of devices. This implicitly assumes the hardware is a Raspberry Pi running Raspberry Pi OS. The devices are there because the default set of add-on nodes added via Dockerfile include those that a user of a Raspberry Pi running Raspberry Pi OS would expect to be there and those, in turn, depend on the device mappings. I realise it's a kind of circular logic but that's the reason. Second, there are containers like Zigbee2MQTT and Octoprint where the left-hand-side of the device mapping uses In the first case, we could resolve it by changing the default set of add-on nodes and omitting the devices but then, of course, users with a "real" Pi would have to put everything back if they wanted to use those add-on nodes. I'm not saying that's a compelling argument against doing it but it's still a consideration (the needs of the many vs the needs of the few stuff). In the second case, not providing a left-hand-side device at all means the container goes into a restart loop. That's bad. The problem then becomes how to identify a suitable placeholder device on arbitrary hardware running an arbitrary OS. The two sides of this problem go together. Any solution needs to address both. But, for now, the menu has no ability to deal with any of this. The best we can do is what we've ready done: document the problem - device errors. This is probably not what you wanted to hear but, for now, it's the best we can do. Sorry. I've tried to give you an explanation-in-depth because, with Andreas' latest video, there are likely to be a lot of people with these same questions. |
To flesh this out a bit more, I don't believe device discovery is a particularly easy problem to solve. I'll use Zigbee2MQTT as my example but the same principles/problems apply to pretty much anything that connects to a host over USB. As shipped, the Zigbee2MQTT template at:
contains the following device mapping:
The right hand side of that device mapping meets the expectation set by the process running inside the container that a Zigbee adapter of some kind will mount as The right hand side is the container's As mentioned before, the left hand side uses
Assume a Raspberry Pi running Raspberry Pi OS with nothing connected to its USB ports other than (perhaps) an SSD. At that point, there is no
docker-compose would complain and refuse to start the container, with:
As you've realised, that's not a particularly useful message because you have to infer that "ttyACM0" might be the problem, hunt for it in your compose file, and then figure out what the heck to do next. Assume a CC2531 Zigbee adapter has been connected. All other things being equal, the adapter will mount as So far, so good. But suppose you have other USB devices connected which manifest as serial ports. Now the order of enumeration comes into play. The Zigbee adapter might be docker-compose can't cope with that kind of variability so, faced with all these moving goal-posts, you either read the IOTstack wiki or Google the topic, then ferret about to identify your adapter by its ID, and you come up with a device mapping like:
Alternatively, you can do what I do and drill into the how-to of writing a UDEV rule so you can use something far more meaningful to mere humans like:
As an aside, if you don't see the sense in going that extra step, consider these three error messages, all of which mean "your Zigbee adapter is not connected":
True, "CC2531" is buried in the second message but the third style directs your attention to your Zigbee adapter. Well, I think so anyway. Now let's bring macOS into the picture. If I connect my Zigbee CC2531 to my iMac, it mounts as For the IOTstack menu to sort that out means it needs to know what your adapter is, whether it's physically connected or not, the conventions of how devices mount on the host OS, how they're likely to be enumerated, and how to disambiguate things that mount with the same name. I reckon that's a bit of a tough ask. And that's just Zigbee2MQTT… Bottom line: any scheme to avoid having to work through designed-for-Pi service definitions, by hand, to adapt them to arbitrary host and OS combinations, would need to be pretty sophisticated. |
I now published my Mac Mini installation notes on my blog: https://frightanic.com/computers/install-iotstack-on-a-mac-mini/ |
Very interesting. Can I ask if you considered installing Debian and running IOTstack there? When Andreas did his recent "Pi alternatives" video, I spun up Debian in Parallels and, aside from the device issues, it just worked. I'd be curious to know what the experience would be from booting a Mac with Debian.
|
I did indeed consider running Debian on the Mac Mini for a brief moment. However, we've only got Macs and Pis in my household and I am so happy with Macs in general that wanted to use the Mini as-is. (Ok, I did replace its old hard disk with an SSD I scraped from an old laptop.) As for "opinionated", yes, IOTStack is opinionated and that's most of the added value for me. I get your opinion by default but can change anything I like - the best of both worlds. |
IOTstack runs fine on debian 11. I use it there for a while. |
After watching the following video, I tried replicating the same installation process on a mini PC. However it seems that many of the requirements of the IoTStack are hard coded for a Raspberry Pi such as:
` devices:
`
Can the installation process be modified to detect automatically on which device the containers are getting installed so that it could adapt accordingly
The text was updated successfully, but these errors were encountered: