hippy
Posts: 5963
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Arduino IDE on Raspberry Pi Zero W

Mon Sep 09, 2019 5:52 pm

spaceman5 wrote:
Mon Sep 09, 2019 4:27 pm
hippy wrote:
Mon Sep 09, 2019 4:06 pm
The 1.8.9 splash screen lasts about 18 seconds on my 3B before the editor itself appears, 75 seconds on my Zero W.
Oh no..
75secs.. definitely not usable..
(actually 18secs is also not usable..)

Maybe I should abandon the idea..
15 seconds of splash screen with 1.8.9 on my multi-core 64-bit desktop PC. None the less I wouldn't consider it unusable on that PC or my 3B.

15 seconds is also the time it takes to launch the off-line Scratch 3 Desktop on that PC, which takes 36 seconds on my Pi 3B.

I am sure all of us desire start-ups times which are infinitesimally small but most would not consider an application unusable just because of prolonged start-up times.

User avatar
scruss
Posts: 2482
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Arduino IDE on Raspberry Pi Zero W

Mon Sep 09, 2019 7:04 pm

If you want a lighter solution, there's the kinda bleeding-edge arduino-cli system:
https://github.com/arduino/arduino-cli

It seems a little rough and takes a while to set up, but each individual build shouldn't take too long once you've got board and core supported. A couple of notes from installing it on my own Raspberry Pi Zero:
  • the installation path should already be in your PATH when you start the curl download script
  • The script pipes output to sh, when I think it would make fewer complaints if piped through bash
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

User avatar
Gavinmc42
Posts: 3742
Joined: Wed Aug 28, 2013 3:31 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 3:11 am

Self hosting a Windowing IDE on top of X11 on a Zero is asking a lot for them.
Most of my BCM2835 gadgets are CLI or baremetal.
If I do any self hosting applications on those it is either shell script or Micropython based.
My IDE for them is MC, Midnight Commander, editor/file manager.

I have to agree with Spaceman5, the older versions were faster.
I don't like these "simple/standard" software things like Arduino/VC/Eclipse/NetBeans/Scratch that require the latest hardware to run fast enough to use.

Need to look at that Piduino stuff :D

My default x11 desktop IDE is Geany, have not tried setting that up with the Arduino compilers.
I never liked running Java stuff on less than a Pi2, it's too slow otherwise.

My Zero coding is done externally, Windows/Linux boxes, now moving to Pi4 hosted.
It is just a matter of using software that is optimised for the hardware and run stuff that not too slow to be painful.
With Linux and baremetal options now we have many choices of tools.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 5:57 am

Gavinmc42 wrote:
Tue Sep 10, 2019 3:11 am
Self hosting a Windowing IDE on top of X11 on a Zero is asking a lot for them.
Most of my BCM2835 gadgets are CLI or baremetal.
Gavinmc42 wrote:
Tue Sep 10, 2019 3:11 am
With Linux and baremetal options now we have many choices of tools.
Yes, maybe my expectations from the board should be adjusted.
Command Line would be more appropriate, from the info that you all give.

BTW,
what do you mean baremetal?
Writing a program that runs on the Zero without an OS even?
(in Assembly language?)

User avatar
Gavinmc42
Posts: 3742
Joined: Wed Aug 28, 2013 3:31 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 7:47 am

BTW,
what do you mean baremetal?
Writing a program that runs on the Zero without an OS even?
(in Assembly language?)
Yep, no OS, check the baremetal forum.
Baremetal has been done in Asm, C, C++, Rust, Pascal(Ultibo)...

In theory you could use Arduino IDE to write baremetal C++ for Pi's.
Not sure if anyone has done it yet?

Zero and A+, B+ run Linux without a x11 desktop quite well.
My preference is PiCore but Raspbian Lite is the Debian compatible way.

I wonder if Dosbox runs on a headless Pi?
1GHz DOS? Not exactly lowered expectations :lol:

Generally it is all the fancy graphics we expect that slows things down.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 12:19 pm

Gavinmc42 wrote:
Tue Sep 10, 2019 7:47 am
Yep, no OS, check the baremetal forum.
Baremetal has been done in Asm, C, C++, Rust, Pascal(Ultibo)...
Interesting..
But you lose all the lower software layers, that the OS provides,
like interfacing hardware, and stuff.

I assume there are libraries for everything, or else you could not develop useful things..

Gavinmc42 wrote:
Tue Sep 10, 2019 7:47 am
Zero and A+, B+ run Linux without a x11 desktop quite well.
...
Generally it is all the fancy graphics we expect that slows things down.
I see
so i would aim more to textual GUI and less for Graphic, with the Zero/Zero W

hippy
Posts: 5963
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 1:09 pm

scruss wrote:
Mon Sep 09, 2019 7:04 pm
If you want a lighter solution, there's the kinda bleeding-edge arduino-cli system:
https://github.com/arduino/arduino-cli
It seems it is possible to use the compiler from the command line without needing that -

Code: Select all

pi@Pi3B:/tmp $ cat x.ino
void setup() {
  printf("Compiled on command line\n");
}

void loop(){
}

Code: Select all

pi@Pi3B:/tmp $ sudo arduino --verify --preserve-temp-files x.ino
Picked up JAVA_TOOL_OPTIONS: 
Loading configuration...
Initialising packages...
Preparing boards...
Verifying...
/usr/bin/arm-linux-gnueabihf-ar: `u' modifier ignored since `D' is the default (see `U')
...

Code: Select all

pi@Pi3B:/tmp $ sudo ./arduino_build_124989/x.ino.bin 
Compiled on command line
^C
That could probably be improved upon by someone more familiar with the tools than I am.

User avatar
scruss
Posts: 2482
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 2:03 pm

hippy wrote:
Tue Sep 10, 2019 1:09 pm
It seems it is possible to use the compiler from the command line without needing that -
It absolutely can be. If you really wanted to, you could just install avrdude and gcc-avr (as long as you were sticking with old-style AVR-based Arduino boards). The solution I listed, though somewhat slow to set up, is supported by the Arduino team and thus likely to stay developed and documented for a while. Unless they have another schism like they did about five years ago …

If you want a purely command line/makefile based solution, install the Arduino IDE (yes, use the new one: it's huge but at least it gives you options when you find an ATMega to be too small, or the client suddenly wants wifi, or ...) then install sudar/Arduino-Makefile (also in the repos: sudo apt install arduino-mk). That gives you a fully command-line, no magic wrappers written in Go, development environment if you like that sort of thing.

Arduinos are no fun to use with a Zero, though. There's the reboot-the-Zero-when-unplugging-USB issue that there's not much you can do about, and then there's the fact that Arduinos should always reboot when you open/reopen their serial connection.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 2:45 pm

scruss wrote:
Tue Sep 10, 2019 2:03 pm
There's the reboot-the-Zero-when-unplugging-USB issue that there's not much you can do about
Can the developers of Raspbian fix it, or even they can't?

hippy
Posts: 5963
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 5:48 pm

spaceman5 wrote:
Tue Sep 10, 2019 2:45 pm
scruss wrote:
Tue Sep 10, 2019 2:03 pm
There's the reboot-the-Zero-when-unplugging-USB issue that there's not much you can do about
Can the developers of Raspbian fix it, or even they can't?
I am not sure anyone even knows what the cause of the problem is, and that's a prerequisite to fixing it, or being able to avoid the issue.

In-rush current would be the most obvious reason; plug a device in, it draws current, causes the supply to drop, causes a reset. But that doesn't appear likely when people are using well-specified official power supplies, nor given that things are fine when a device is plugged in and then power to it switched on. Only when switched on while being plugged in is there a problem. And at least one poster has reported it depends on the length of cable -

https://www.raspberrypi.org/forums/view ... p?t=237554

OTOH, I have been using a Zero W with a cheapo 1A PSU, swapping a hefty current drawing keyboard and optical mouse on my OTG cable ( because I don't have a suitable hub ) and not had one reboot.

Perhaps some boards are more susceptible than others. It has been reported that the PMIC has changed on later versions to a model which is more sensitive to voltage drop rate of change which could be a part of the issue but I don't know. No one seems to.

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 6:27 pm

I think someone wrote here earlier that the problem expresses when disconnecting a USB device,
and now you write that it happens when connecting..

So does it happen on both?


In any case, is the thread that was opened (the one you linked to) enough to raise the issue to the developers,
or maybe some issue needs to be opened in a Bug Tracking system?

User avatar
scruss
Posts: 2482
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Arduino IDE on Raspberry Pi Zero W

Tue Sep 10, 2019 8:44 pm

spaceman5 wrote:
Tue Sep 10, 2019 2:45 pm
scruss wrote:
Tue Sep 10, 2019 2:03 pm
There's the reboot-the-Zero-when-unplugging-USB issue that there's not much you can do about
Can the developers of Raspbian fix it, or even they can't?
No it's a hardware problem — it affected the early Raspberry Pi Model 1s too, fixed in the 1B+.

All my Zeroes reset when hot-plugging USB, and I'm using the (overkill) official 2.5 A power supply. I didn't know that this was a "sometimes" problem.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Wed Sep 11, 2019 5:20 am

I see.
OK, the workaround to it is to shutdown before connecting/disconnecting,
I will remember that :)

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Fri Sep 13, 2019 7:06 am

BTW
Just to verify,
does this USB problem happen in both the Zero and Zero W,
or just in one of them?

User avatar
scruss
Posts: 2482
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Arduino IDE on Raspberry Pi Zero W

Fri Sep 13, 2019 1:18 pm

Both are affected.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

spaceman5
Posts: 57
Joined: Sun Aug 25, 2019 5:26 am

Re: Arduino IDE on Raspberry Pi Zero W

Fri Sep 13, 2019 1:20 pm

Good to know
Thank you

Return to “Beginners”