arduinoraspberry-pi

How to use Arduino IDE on Raspberry Pi OS to program a Digispark ATTiny85


everyone, i've been trying to use Arduino IDE 1.8.12 to compile scripts into a Digispark ATTiny85 usb board from a 4GB Raspberry Pi 4 running Raspberry Pi OS.

First problem i was that when going to the IDEs board manager to install the Digistump, it gave back the "micronucleus is not available for your operating system" error. I managed to work around this by replacing the json url suggested by digistump by the one provided on the second entry of this post. After doing so, a "compatible" version of Digistump was listed on the boards manager and was able to successfully select the Digispark board and the micronucleus programmer under the Arduino IDEs Tools dropdown menu.

This is where the second problem appeared: As i compile the script, the Arduino IDE console returns the following message:

" Arduino: 1.8.12 (Linux), Board: "Digispark (Default - 16.5mhz)" Sketch uses 2788 bytes (46%) of program storage space. Maximum is 6012 bytes. Global variables use 124 bytes of dynamic memory. An error occurred while uploading the sketch /home/pi/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher: 1: /home/pi/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher: Syntax error: word unexpected (expecting ")") " And that's as far as i could go without getting messy or going into stuff i didn't quite understand.

Now, a few considerations:

-As I said, im running raspberry pi os on a 4GB raspberry pi 4 and using Arduino IDE 1.8.12

-Also, im kind of a newbie, even though i've been coding on an arduino UNO for about a year, i've never tried any other boards, also, I got the pi on march this year and it IS my first encounter with linux based systems, I've noticed things can get really messy or complex very fast so please have patience with me :)

-This is my first stackoverflow question and even though i've read the guidelines to posting questions here, something might have escaped my attention, also, i did search for this before asking but again, maybe i didn't see the right post, if my question is either poorly detailed, already answeed elsewhere, or anyhing can be improved about it, please let me know.

thank you all in advance for the amazing community you carry upon your shoulders.

cheers from argetina Yeti.


Solution

  • To anyone out there who might run into this problem, I was able to fix this by following a comment on the post linked on the question, by doing:

    sudo apt install git                                 
    git clone https://github.com/micronucleus/micronucleus                     
    cd micronucleus/commandline/
    sudo apt install libusb-dev
    make
    cp micronucleus ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4
    
    sudo cp 49-micronucleus.rules /etc/udev/rules.d/. 
    
    git clone https://github.com/digistump/avr-dummy
    cd avr-dummy
    make
    cp avrdude ~/.arduino15/packages/digistump/tools/micronucleus/2.0a4/launcher
    

    Note: I had already done this before, but I think it didn't work because i had gotten messy with the alternatives, this option worked for me only after doing a fresh installation Arduino IDE.

    Like on that arduino.cc post, I am now able to upload my payloads to the digispark with no problem what so ever.

    Cheers