comp.lang.ada
 help / color / mirror / Atom feed
* Raspberry Pi SenseHAT / AstroPi
@ 2018-01-23 15:45 slos
  2018-01-23 16:33 ` Dennis Lee Bieber
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: slos @ 2018-01-23 15:45 UTC (permalink / raw)


Hi there,

To play with Raspberry Pi I have a SenseHAT, renamed from AstroPi, which is a HAT with some sensors :
https://www.raspberrypi.org/documentation/hardware/sense-hat

Since it was designed to go in space, I would have thought an Ada library to be available... ;-)
But I could not find one. :-(

So what can be found is a Python library on top of a C++ one.

But maybe I have missed something already done in Ada ?

Best Regards,
Stéphane


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 15:45 Raspberry Pi SenseHAT / AstroPi slos
@ 2018-01-23 16:33 ` Dennis Lee Bieber
  2018-01-30 23:00   ` Luke A. Guest
  2018-01-23 17:40 ` Dmitry A. Kazakov
  2018-01-25 11:12 ` Philip Munts
  2 siblings, 1 reply; 11+ messages in thread
From: Dennis Lee Bieber @ 2018-01-23 16:33 UTC (permalink / raw)


On Tue, 23 Jan 2018 07:45:17 -0800 (PST), slos <new.stephane.los@gmail.com>
declaimed the following:


>Since it was designed to go in space, I would have thought an Ada library to be available... ;-)
>But I could not find one. :-(
>

	It may have gone into space -- but it is not part of safety
critical/operational control electronics; it is isolated (other than power
supply I suspect*) from the rest of the environment.

	Per astro-pi.org itself, the "missions" MUST use Python (given that the
advanced mission is limited to <19 year old, I doubt any candidates would
know enough Ada to interface with hardware). 

cf:
http://esamultimedia.esa.int/docs/edu/Mission_Space_Lab_coding_rules.pdf

	Astro-Pi submittals are in Python source code so the reviewers can
easily ensure that no potentially malicious code exists (no use of
networking libraries, no spawning of external programs, etc.). Use of most
any other language would mean using /binary/ executables -- and that would
mean, for safety review, that the reviewers would have to also build the
programs from sources in order to provide them to the spacecraft. Much too
much overhead on the staff.


* based upon the coding rules, they are networked to the spacecraft systems
(which would support the upload of selected experiments) but are not
permitted to use networking during runs.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 15:45 Raspberry Pi SenseHAT / AstroPi slos
  2018-01-23 16:33 ` Dennis Lee Bieber
@ 2018-01-23 17:40 ` Dmitry A. Kazakov
  2018-01-23 19:18   ` Dennis Lee Bieber
  2018-01-23 21:30   ` slos
  2018-01-25 11:12 ` Philip Munts
  2 siblings, 2 replies; 11+ messages in thread
From: Dmitry A. Kazakov @ 2018-01-23 17:40 UTC (permalink / raw)


On 2018-01-23 16:45, slos wrote:

> To play with Raspberry Pi I have a SenseHAT, renamed from AstroPi, which is a HAT with some sensors :
> https://www.raspberrypi.org/documentation/hardware/sense-hat
> 
> Since it was designed to go in space, I would have thought an Ada library to be available... ;-)
> But I could not find one. :-(

Way too expensive and useless for automation purposes. There are 
virtually thousands of different hats you cannot expect all of them 
supported.

Anyway for [semi-]serious use one usually designs a new one. E.g. for a 
BeagleBone board our partner designed a hat with many A/D converters and 
a tiger chip.

The problem is that the architecture of ARM boards does not allow use of 
modular components. A monolithic sensor/actuator board never has a 
chance to meet the requirements, so one must design it new each time.

> So what can be found is a Python library on top of a C++ one.

Actually I would expect a proper driver. A C library means it must run 
with root privileges. Not good.

> But maybe I have missed something already done in Ada ?

What for? If you say that there is a C library, you can call it directly 
from Ada.

P.S. We could consider supporting it in our middleware, but as I said, 
at first glance it looks too expensive and much useless. Then it does 
not scale other architectures. We usually support boards / protocols 
available for more that just Raspberry Pi. Raspberry Pi has a very bad 
call among customers. One can show it as proof of the concept but 
nothing more.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 17:40 ` Dmitry A. Kazakov
@ 2018-01-23 19:18   ` Dennis Lee Bieber
  2018-01-23 20:29     ` Dmitry A. Kazakov
  2018-01-23 21:30   ` slos
  1 sibling, 1 reply; 11+ messages in thread
From: Dennis Lee Bieber @ 2018-01-23 19:18 UTC (permalink / raw)


On Tue, 23 Jan 2018 18:40:09 +0100, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> declaimed the following:


>Anyway for [semi-]serious use one usually designs a new one. E.g. for a 
>BeagleBone board our partner designed a hat with many A/D converters and 
>a tiger chip.
>

	The BeagleBone is too stylish to wear a hat... They wear capes, instead
<G> {Does that mean Arduinos are cowering behind their shields?}
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 19:18   ` Dennis Lee Bieber
@ 2018-01-23 20:29     ` Dmitry A. Kazakov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry A. Kazakov @ 2018-01-23 20:29 UTC (permalink / raw)


On 2018-01-23 20:18, Dennis Lee Bieber wrote:
> On Tue, 23 Jan 2018 18:40:09 +0100, "Dmitry A. Kazakov"
> <mailbox@dmitry-kazakov.de> declaimed the following:
> 
> 
>> Anyway for [semi-]serious use one usually designs a new one. E.g. for a
>> BeagleBone board our partner designed a hat with many A/D converters and
>> a tiger chip.
>>
> 
> 	The BeagleBone is too stylish to wear a hat... They wear capes, instead
> <G> {Does that mean Arduinos are cowering behind their shields?}

and if worn on a hat?

    https://shop.pimoroni.com/products/esp8266-phat

(:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 17:40 ` Dmitry A. Kazakov
  2018-01-23 19:18   ` Dennis Lee Bieber
@ 2018-01-23 21:30   ` slos
  2018-01-23 22:02     ` Dmitry A. Kazakov
  2018-01-23 23:03     ` Dennis Lee Bieber
  1 sibling, 2 replies; 11+ messages in thread
From: slos @ 2018-01-23 21:30 UTC (permalink / raw)


Le mardi 23 janvier 2018 18:40:16 UTC+1, Dmitry A. Kazakov a écrit :
> On 2018-01-23 16:45, slos wrote:
> 
> > To play with Raspberry Pi I have a SenseHAT, renamed from AstroPi, which is a HAT with some sensors :
> > https://www.raspberrypi.org/documentation/hardware/sense-hat
> > 
> > Since it was designed to go in space, I would have thought an Ada library to be available... ;-)
> > But I could not find one. :-(
> 
> Way too expensive and useless for automation purposes.
Well, I just wanted to play with some sensors and there are some on this SenseHat which costs by the way less than 40 Euros.
And connecting it to a PLC could be fun by allowing to control some process / machine like with a Wii Remote :
https://en.wikipedia.org/wiki/Wii_Remote
> There are 
> virtually thousands of different hats you cannot expect all of them 
> supported.
Of course since the HAT connector provides only signals like GPIO, I2C, SPI, UART, you can connect whatever you want to it. And of course you can design your own.
> 
> Anyway for [semi-]serious use one usually designs a new one. E.g. for a 
> BeagleBone board our partner designed a hat with many A/D converters and 
> a tiger chip.
This SenseHat is for discovering / fun / demo / what you can think of, and isn't that expensive. And one can just plug it on top and use the provided software to start playing.
> 
> The problem is that the architecture of ARM boards does not allow use of 
> modular components. A monolithic sensor/actuator board never has a 
> chance to meet the requirements, so one must design it new each time.
Or use one that fits with their needs.
> 
> > So what can be found is a Python library on top of a C++ one.
> 
> Actually I would expect a proper driver. A C library means it must run 
> with root privileges. Not good.
Why would you need root privileges to run a C library ?
You have to set the proper rights to a user or group and that should suffice.
> 
> > But maybe I have missed something already done in Ada ?
> 
> What for? If you say that there is a C library, you can call it directly 
> from Ada.
No, I said there is a C++ library and a Python binding on top.
Actually the Python library uses the C++ library for some sensors and devices directly for joystick and framebuffer.
> 
> P.S. We could consider supporting it in our middleware, but as I said, 
> at first glance it looks too expensive and much useless.
It could allow some people interested in Ada language to play on an inexpensive target. Is it useless ?
The Raspberry Pi was designed exactly for that purpose. Teaching and experiments for anyone interested in.
> Then it does 
> not scale other architectures. We usually support boards / protocols 
> available for more that just Raspberry Pi. Raspberry Pi has a very bad 
> call among customers. One can show it as proof of the concept but 
> nothing more.
> 
> -- 
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
Stéphane

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 21:30   ` slos
@ 2018-01-23 22:02     ` Dmitry A. Kazakov
  2018-01-23 23:03     ` Dennis Lee Bieber
  1 sibling, 0 replies; 11+ messages in thread
From: Dmitry A. Kazakov @ 2018-01-23 22:02 UTC (permalink / raw)


On 2018-01-23 22:30, slos wrote:

> Of course since the HAT connector provides only signals like GPIO,
> I2C, SPI, UART, you can connect whatever you want to it.
Well, usually we use BeagleBone which has that already and more, e.g. 
CAN. But the problem is that a bit different stuff is needed, in 
automation, at least: a few A/D and D/A converters, minimally 16-bit, 
independently sampled, with an optocoupler, some for PT100, an 
incremental encoder or a frequency meter.

> Why would you need root privileges to run a C library ? > You have to set the proper rights to a user or group and that should 
suffice.

That could work if internals of the library is known, e.g. all things it 
accesses and all ways it uses. Finding all these and experimenting might 
take a lot of time. When there is a proper driver it is just one place 
to fix.

>> What for? If you say that there is a C library, you can call it directly
>> from Ada.
> No, I said there is a C++ library and a Python binding on top.
> Actually the Python library uses the C++ library for some sensors and devices directly for joystick and framebuffer.

Is the library documented? Then there is no problem. Python does not 
have anything what Ada does not have already. Surely Ada's C++ interface 
is a bit daring, but Python has none of that sort. My guess is that all 
interface is plain C.

> It could allow some people interested in Ada language to play on an inexpensive target. Is it useless ?
> The Raspberry Pi was designed exactly for that purpose. Teaching and experiments for anyone interested in.

Yes, but that would not pay salaries, unfortunately.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 21:30   ` slos
  2018-01-23 22:02     ` Dmitry A. Kazakov
@ 2018-01-23 23:03     ` Dennis Lee Bieber
  1 sibling, 0 replies; 11+ messages in thread
From: Dennis Lee Bieber @ 2018-01-23 23:03 UTC (permalink / raw)


On Tue, 23 Jan 2018 13:30:36 -0800 (PST), slos <new.stephane.los@gmail.com>
declaimed the following:

>It could allow some people interested in Ada language to play on an inexpensive target. Is it useless ?
>The Raspberry Pi was designed exactly for that purpose. Teaching and experiments for anyone interested in.

	The RPi was designed for an educational usage, yes -- but it is
commonly believed that the "Pi" part of the name was influenced by "Python"
as the language of choice.

	Ada was never really designed as a language for quick experimentation.
For data-processing type applications, one can create programs using the
stock library (I'm talking the type of processing that made use of fixed
format record layouts -- even use of an RDBM gets a bit advanced in Ada,
and I don't want to consider what a GUI takes).

	For Linux on RPi (and BBB), the common /base/ for GPIO and other
special peripherals is to use the sys file system -- by opening virtual
files representing pins, PWM, etc. and doing read/write operations. Lots of
latency as one is using POSIX I/O calls which transfer from user mode to
kernel and back -- but is available to /any/ language capable of opening
arbitrary files -- no libraries are needed.

	The next layer above that is a simple library which handles the
formation of the proper sysfs file names while masking them from the user
-- one calls a function to write to a pin, and the library generates the
file name appropriate for that pin, opens said file, writes the value, and
closes the file.

	Beyond that you are in the realm of doing things like mmap a memory
block into the processor peripheral I/O space -- which often requires root
privilege -- and writing bits to the actual I/O ports. This is beyond the
simple experimenters that are the target of the RPi/BBB. In Ada, this would
be using address attributes on variable declarations (not quite an
example):
http://www.adaic.org/resources/add_content/docs/95style/html/sec_5/5-9-4.html
And I'd consider that quite an advanced subject -- one would need to study
the reference for the SoC in use to determine the proper addresses, and
bits within that address (since GPIO ports typically are multiple bits
wide). One would need to be able to ensure the addresses are hardware
addresses, and not the virtual address blocks seen by user-land Linux
programs. So... bare-board (no OS) with ALL I/O, including simple serial
port console needs to be coded...

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 15:45 Raspberry Pi SenseHAT / AstroPi slos
  2018-01-23 16:33 ` Dennis Lee Bieber
  2018-01-23 17:40 ` Dmitry A. Kazakov
@ 2018-01-25 11:12 ` Philip Munts
  2018-01-29 14:40   ` slos
  2 siblings, 1 reply; 11+ messages in thread
From: Philip Munts @ 2018-01-25 11:12 UTC (permalink / raw)


I have written some Ada packages and test programs for the Sense HAT.  The platform independent sensor drivers are in libsimpleio:

http://git.munts.com/libsimpleio/ada/

The platform dependent code is in MuntsOS:

http://git.munts.com/arm-linux-mcu/examples/ada

My code use the i2c-dev interface rather than kernel drivers.  I had to reverse engineer the display and joystick from the AVR firmware source code.

I primarily target my own embedded Linux distribution, MuntsOS, but the test programs all run on Raspbian as well.

Phil

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-25 11:12 ` Philip Munts
@ 2018-01-29 14:40   ` slos
  0 siblings, 0 replies; 11+ messages in thread
From: slos @ 2018-01-29 14:40 UTC (permalink / raw)


Le jeudi 25 janvier 2018 12:12:59 UTC+1, Philip Munts a écrit :
> I have written some Ada packages and test programs for the Sense HAT.  The platform independent sensor drivers are in libsimpleio:
> 
> http://git.munts.com/libsimpleio/ada/
> 
> The platform dependent code is in MuntsOS:
> 
> http://git.munts.com/arm-linux-mcu/examples/ada
> 
> My code use the i2c-dev interface rather than kernel drivers.  I had to reverse engineer the display and joystick from the AVR firmware source code.
> 
> I primarily target my own embedded Linux distribution, MuntsOS, but the test programs all run on Raspbian as well.
> 
> Phil

Thank you very much Phil.

BR,
Stéphane


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Raspberry Pi SenseHAT / AstroPi
  2018-01-23 16:33 ` Dennis Lee Bieber
@ 2018-01-30 23:00   ` Luke A. Guest
  0 siblings, 0 replies; 11+ messages in thread
From: Luke A. Guest @ 2018-01-30 23:00 UTC (permalink / raw)


Dennis Lee Bieber <wlfraed@ix.netcom.com> wrote:

> 
> 	Per astro-pi.org itself, the "missions" MUST use Python (given that the
> advanced mission is limited to <19 year old, I doubt any candidates would
> know enough Ada to interface with hardware). 

Could always supply the source and let them build it, not hard.


> cf:
> http://esamultimedia.esa.int/docs/edu/Mission_Space_Lab_coding_rules.pdf
> 
> 	Astro-Pi submittals are in Python source code so the reviewers can
> easily ensure that no potentially malicious code exists (no use of


Like sticking two fingers up at any alien it may come across 😍 ;)


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-30 23:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 15:45 Raspberry Pi SenseHAT / AstroPi slos
2018-01-23 16:33 ` Dennis Lee Bieber
2018-01-30 23:00   ` Luke A. Guest
2018-01-23 17:40 ` Dmitry A. Kazakov
2018-01-23 19:18   ` Dennis Lee Bieber
2018-01-23 20:29     ` Dmitry A. Kazakov
2018-01-23 21:30   ` slos
2018-01-23 22:02     ` Dmitry A. Kazakov
2018-01-23 23:03     ` Dennis Lee Bieber
2018-01-25 11:12 ` Philip Munts
2018-01-29 14:40   ` slos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox