How to install micronucleus to OpenHABian?

I’ve tried to flash ATTiny85 USB board to have more I2C buses on RPi4, based on this recommendation:

But micronucleus is not installed by default on habian 2.5.2.

  • can not find it at Debian repo
  • Also tried to copy the main.c and makefile files from github, and run:
    sudo make makefile … and similar syntaxes, but I’m not good at Linux + C

Can someone help me please? Thanks!!

If you mean openHABian, it is just Raspbian Lite. Search the other forums for that.

Not very helpful… :frowning:
I’ve searched for 5 hours long. That’s why I’m asking now, to get help!

PS: Yes, I mean OpenHABian. IMHO that SD-card image should contain everything what could needed for newbees like me. It is very very hard to go forward, if not even a simple SWITCH or RELAY is working “out of the box” !

I thought you were basically wanting to install micronucleus on Raspbian. This forum only supports openHAB and does not keep a catalog of other packages.

Sorry again if I misunderstood. I made the assumtion you did not realize the openHABian image is just Raspbian Lite with the openHABian scripts added.

1 Like

No, I didn’t knew that. Thanks!
Although I’ve thought someone has done this before, because it would be crucial to create devices compatible with OH… and for that a special firmware is needed.

It’s also a suggestion from me how to improve the OpenHABian image:

  • what is missing,
  • how could be this whole installation process turned into fun, and not a nightmare.
1 Like

There are a zillion hardware options out there, so it only makes sense that not all are supported by Raspbian/Debian with a package (pre-installed or in the repository).

To be sure we are on the same page: micronucleus is a small bootloader for the ATTiny/ATMega series of MCU’s, it’s not something that can run on a Linux system like Raspbian.

Having said that, there is a command line tool included in the micronucleus repository to flash the bootloader to an AVR MCU based system. To run that, clone the repository, follow the included documentation and flash the bootloader. It can be run on Windows and macOS just fine. No need to use the Raspberry Pi for that.

1 Like

Thanks for the long answer.
If it would be so easy, I would have already done so.

The precompiled .exe does not run under Win32.
Tried to run on an other PC (Win7 64bit), but turned out I would need minGW and something… (don’t remember exactly).
Obviously I’m not prepared to install things on my daily developer machine that could compromise my income.

It would be logical to run it on the Pi itself. The only question is:

  • HOW?

For example:

  • Is it possible to “upgrade” the Rasp. Light to a Full version?
  • Would it work than?
    my Pi4 has 4GB ram, 32GB SD card + 16GB pendrive and just minimal portion is used from those.

Do you mean to run the full desktop version of Raspbian? Yes it is, but not by using an openHABian image AFAIK. You’ll have to flash a Raspbian Full Desktop image and then download and install the openHABian installer to get a running OH.

Not necessarily, because flashing the bootloader is just an one-time preparation of the device, but if you want to flash it from Linux, your best bet is to turn to a forum that supports micronucleus, because that has nothing to do with openHAB.

Mind you: An ATTiny does not come out-of-the-box with support for USB connections. You need to flash the bootloader on it first. For that you need an ISP programmer connected to the ATTiny board. An Arduino, flashed with a small program, can act as the ISP programmer with a tool like AVRDUDE, or dedicated programmer hardware. There are many tutorials on that - have a look at the Adafruit or Sparkfun website. Also here is another example of how to flash the AVR ATTiny MCU.

Modern Linux kernels come with support for I2C-to-USB and should work once you have micronucleus flashed on the device.

1 Like