473,890 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python for Embedded Systems?

Is there a Python packaging that is specifically for
embedded systems? ie, very small and configurable so the
user gets to select what modules to install?

For Linux-based embedded systems in particular?

I'm thinking of running it on the Linksys's Linux-based open
source router WRT54G. It has 4MB flash and 16MB RAM. I think
another model has 16MB flash. Any possibilities of running
Python on these systems?

If Python is not the best candidate for embedded systems because
of the size, what (scripting) language would you recommend?

PHP may fit but I don't quite like the language. Anything else?
Loa is small but it does not seem to be powerful enough.
Jul 14 '06
20 22567
Paul Rubin <http://ph****@NOSPAM.i nvalidwrites:
SIOD was a well known very small Scheme interpreter that you might
like to play with:

http://en.wikipedia.org/wiki/SIOD
Here's another one that I like. I haven't actually used it but
studied it for possible integration in an embedded project that I
worked on but that got cancelled. It seems very good for this type of
thing. The runtime system is just 20k bytes or so:

http://hedgehog.oliotalo.fi/

Picolisp is also pretty neat but maybe not aimed the same way:

http://software-lab.de/down.html

Take the challenge: it is very impressive. Of course they tailored it
to Pico Lisp's capabilities, but you can see the challenge problem is
very sensible, and the Pico Lisp solution is much easier to get to
than a Python solution:

http://software-lab.de/succ.html
Jul 15 '06 #11
Jack wrote:
Is there a Python packaging that is specifically for
embedded systems? ie, very small and configurable so the
user gets to select what modules to install?
You might also look at the gumstix embedded system, Linux running on an
ARM processor in an extremely small form factor.
(http://www.gumstix.net/)

And here is a page with a link to a gumstix Python binary:
http://cs.gmu.edu/~eclab/projects/ro...?n=Main.Python

I'm trying this out as soon as I get home!

-- Paul

Jul 15 '06 #12
Jack wrote:
Is there a Python packaging that is specifically for
embedded systems? ie, very small and configurable so the
user gets to select what modules to install?

For Linux-based embedded systems in particular?

I'm thinking of running it on the Linksys's Linux-based open
source router WRT54G. It has 4MB flash and 16MB RAM. I think
another model has 16MB flash. Any possibilities of running
Python on these systems?
Here's another recently announced hobbyist microcontroller system:
http://makezine.com/controller/

Uses Atmel SAM7X processor, ARM7, 32-bit, 256K Flash, 64K SRAM, up to
55MHz.

On-board Ethernet and CAN (Controller Area Network - wireless)

Various I/O blocks and on-board sensors

~US$150

Start shipping Aug 1st.

No Python binary yet, but cross-platform tools are available. The guys
at this magazine could really get a jump with a Python build. Here's a
related site for this kit: www.uCHobby.com

-- Paul

Jul 15 '06 #13
>
On-board Ethernet and CAN (Controller Area Network - wireless)
Ooops, my bad - CAN is not wireless, it is a serial network
specifically for linking with other ucontroller boards.

I was thinking of the onboard Bluetooth of the gumstix boards.

-- Paul

Jul 15 '06 #14
Yes, I mean Lua, not Loa :-p

Lua is a nice language. Like you said, it doesn't have many libraries
as Python does. Plus, it's still evolving and the libraries are changing.
I found a few functions not working last time I tried kepler libraries.
It's good for embedded systems though because of its small footprint.
Extensions implemented in C makes it possible that the installation size
doesn't blow up when new stuff is added, like in Python.

But I still like Python better for its power and for the style of the
language
itself. And I was hoping to find a Python implementation that bears the
principles of Lua to make it suitable for embedded systems :)
>PHP may fit but I don't quite like the language. Anything else?
Loa is small but it does not seem to be powerful enough.
>You mean Lua ? Not powerful enough ? What do you mean by
that ? Lua is great IMHO. Sure it does not come with thousands
of libraries, but the language design is extremely clean, the
language constructs powerful and the footprint very small.
>16kloc of C code can't hurt your embedded device can they ? ;)
>Please tell us what kind of limitation you find in Lua ...
>Cheers,
>SB

Jul 15 '06 #15
In article <n7************ *************** ***@comcast.com >,
Jack <no****@invalid .comwrote:
>Yes, I mean Lua, not Loa :-p

Lua is a nice language. Like you said, it doesn't have many libraries
as Python does. Plus, it's still evolving and the libraries are changing.
I found a few functions not working last time I tried kepler libraries.
It's good for embedded systems though because of its small footprint.
Extensions implemented in C makes it possible that the installation size
doesn't blow up when new stuff is added, like in Python.

But I still like Python better for its power and for the style of the
language
itself. And I was hoping to find a Python implementation that bears the
principles of Lua to make it suitable for embedded systems :)
>>PHP may fit but I don't quite like the language. Anything else?
Loa is small but it does not seem to be powerful enough.
>>You mean Lua ? Not powerful enough ? What do you mean by
that ? Lua is great IMHO. Sure it does not come with thousands
of libraries, but the language design is extremely clean, the
language constructs powerful and the footprint very small.
>>16kloc of C code can't hurt your embedded device can they ? ;)
>>Please tell us what kind of limitation you find in Lua ...
Jul 15 '06 #16
In article <ma************ *************** ************@py thon.org>,
Carl J. Van Arsdall <cv*********@mv ista.comwrote:
Jul 15 '06 #17
cl****@lairds.u s (Cameron Laird) writes:
Yes and no. Python could thrive for the next decade while
utterly surrendering the small-and-embedded domain to Forth,
Lua, Tcl, Scheme, and so on, so, no, there's no *need* for a
TinyPython. On the other hand, yes, there are at least several
of us with an interest and occasional opportunities for Python
in such applications.
I think we should see what happens with PyPy, which might be easier to
target at embedded platforms than CPython is. Main thing needed would
be a static compiler--I haven't followed PyPy enough to know if it
relies on having Psyco at runtime.
Jul 15 '06 #18
In article <7x************ @ruckus.brouhah a.com>,
Paul Rubin <http://ph****@NOSPAM.i nvalidwrote:
>cl****@lairds. us (Cameron Laird) writes:
>Yes and no. Python could thrive for the next decade while
utterly surrendering the small-and-embedded domain to Forth,
Lua, Tcl, Scheme, and so on, so, no, there's no *need* for a
TinyPython. On the other hand, yes, there are at least several
of us with an interest and occasional opportunities for Python
in such applications.

I think we should see what happens with PyPy, which might be easier to
target at embedded platforms than CPython is. Main thing needed would
be a static compiler--I haven't followed PyPy enough to know if it
relies on having Psyco at runtime.
PyPy indeed presents exciting prospects.
Jul 16 '06 #19
Carl J. Van Arsdall wrote:
This raises a good question. Is there a need for python to change
somewhat to work better in an embedded profile?
When I asked this question last on python-dev, there was exactly one
response, and that was "yes, it needs to change".

The natural question then is "in what way?". To this, the answer
was surprising: It needs better support for cross-compilation.
Apparently, cross-compiling Python is very painful, and I guess
cross-compiling distutils-based packages even more so.

Contributions in that direction are welcome.

Regards,
Martin
Jul 16 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2993
by: Bill Hanna | last post by:
C is inadequate for embedded systems for the following reasons: 1) Direct addressing of memory mapped I/O is not supported simply and easily. You have to find work-arounds that are compiler dependent. You have to create macros , use casting and use indirect addressing (pointers) to read or write to memory mapped I/O. 2) C does not support real time interrupts. The interrupt vectoring is compiler dependent.
49
9010
by: Alex Vinokur | last post by:
Are there any restrictions/problems for use of C++ STL in development in embedded systems? In particular: * Does STL require too much space/memory? * Is 'implementation of STL algorithms/methods' reenterable/reentrant? * What is the cost to provide continuity of vectors in memory? Any other problems? -- Alex Vinokur
10
2536
by: Alex Vinokur | last post by:
The memory allocation issue in embedded systems is usually critical.. How can one manage that? 1. Via 'new' char* p = new (nothrow) char ; if (p == 0) { // He we know that it is impossible to allocate the requested memory // We can do something relevant.
2
1316
by: pdeivanayagam | last post by:
hi i hav cmpltd my engg.i am thnkng of doing an embedded systems. course...can i knw abt prospect of embedded systems?wut will be the oppurtunities available in embedded systems?i want some infm reg this.can anyone guide me reg this? regards deivanayagam
27
2108
by: kvnsmnsn | last post by:
I've written a piece of code that interfaces with Postgres. It needs to write a Postgres table to disk, which it does with the <COPYcom- mand. That command requires the absolute file name of the file being written to. Right now I've got it hard coded to the exact location where I want it, but that's not very portable. Is there some way in C to retrieve the absolute path name of the current directory, so that I could use that in my code...
14
1904
by: Martin Wells | last post by:
When I want to store a number, I use "unsigned". I go with unsigned because it's the natural type for the system, and so should be the fastest. However, there are 8-Bit microcontrollers out there that do 8-Bit arithmetic faster than 16-Bit arithmetic, and so on these systems char is faster than int. Standarising C in such a way that int is at least 16-Bit, has this made C both slow and memory-hungry for embedded systems programming?
20
2066
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
There are a few guarantees I exploit in the C Standard. For instance, I might write (unsigned)-1 to get the maximum value for an unsigned integer. Also, I might rely on things such as: memset(data,-1,sizeof data)
30
4316
by: =?ISO-8859-1?Q?Tom=E1s_=D3_h=C9ilidhe?= | last post by:
Let's say we had a simple function for returning the amount of days in a month: unsigned DaysInMonth(unsigned const month) { switch (month) { case 8: case 3: case 5:
0
9977
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11218
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10452
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9618
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8009
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5837
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4260
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3268
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.