Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Is Perl on the Raspberry Pi worth it?

by stevieb (Canon)
on Jun 17, 2019 at 02:48 UTC ( [id://11101452]=perlmeditation: print w/replies, xml ) Need Help??

Since 2016, I've been doing a lot of work regarding the Raspberry Pi with Perl.

Everyone has their interests, engagements and excitement, but I've been working very hard on a significant test platform for my Perl software against the Pi, but I'm starting to understand that there's few others besides me who uses it.

Yes, it's totally a hobby, and I'm happy doing the datasheet translation, soldering of ICs, calculation of resistors and capacitors etc, but is there any real reason to continue to do this for Perl if it isn't being used by anyone else? I enjoy doing this; I enjoy writing the low-level code and bringing it to front so that there's a Perl API. I enjoy this community.

Is it only us old-timers here anymore? What if I sold hardware kits to put together? Does it matter anymore?

I am not saying I will stop writing code for stuff for the Pi in Perl (because Perl is, and will always be my favourite language), I'm just questioning my moves forward. Python clearly has its shit together, but script writers in Python are (typically) not that great, so I'm at a loss here.

This is a mind-fsck question, so answers be damned. I'm as lost as you are ;)

Replies are listed 'Best First'.
Re: Is Perl on the Raspberry Pi worth it?
by GrandFather (Saint) on Jun 17, 2019 at 04:38 UTC

    Is the book selling? That is some indicator of interest or otherwise.

    I have a (very) little interaction with RP, mostly cleaning up someone else's code which is almost always written in Python. In some cases it clean up the Python. In one case it was rewrite it in C++. In most cases Perl would be a more attractive option if I thought the people who own the gear would wear it, but I doubt they would. Each of these systems is essentially one off (an "edge of space" balloon project and a couple of remote data collection systems) so would be great candidates for Perl, if I could get buy in. The balloon project involved a bunch of mid level school students who came with the usual Python indoctrination to the extent that they were involved in the coding at all. The data collection systems were provided by the Japanese researchers with code written by students, collaborators or maybe a hired "processional". In any case none of it was pleasant to look at!

    So yes, Perl on the Pi is worth it, if I could just find an opportunity to use it!

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond

      The book is selling, slowly. It's my first experience with being a published author, so whether sales are good for the target audience is something I don't have the experience to put into any form of statistics. That said, Timm and I have been approached by another distributor, and we're in discussions on licensing them the book, with the prospect of adding to it, or writing another one.

      If you do run into a situation where you find an opportunity to use Perl on the Pi, please, feel free to reach out to me directly (my email is on my CPAN page), or just throw it out here on PM. I'm known to be here from time-to-time ;)

        FWIW, a friend of mine is an author with 20 published books to his name, one became a Hollywood theatrical release, and he’s living on close to nothing. Even successful authors, musicians, artists often make something near or barely better than minimum wage when you figure in their time and materials; $100K for a book seems awesome until you consider it may have taken four years to write. When I was busy being a starving artist chump back in the day I calculated my hourly wages after all expenses at the end of the business run at about 15¢/hour. :P

        Probably damning to say it but I became a Perl hacker because I was tired of being straight-up poor and it felt more like creative writing to me than real work.

Re: Is Perl on the Raspberry Pi worth it?
by marto (Cardinal) on Jun 17, 2019 at 06:12 UTC

    I seem to recall a short lived blogs.perl post along these lines. How do you know nobody uses your stuff? I don't think it's fair to brand all fresh graduates in this way, nor understand what point you're trying to make regarding Python. Going down the route of selling hardware kits yourself I don't believe will resolve whatever problems you're concerned about. Some of what you wrote here seems contradictory. If as you say you enjoy these things why wouldn't you do it? What more justification do you want?

    Update: Part of this reply doesn't make sense now, as OP edited the post, removing part of what they said.

Re: Is Perl on the Raspberry Pi worth it?
by haukex (Archbishop) on Jun 19, 2019 at 20:34 UTC

    I have several Raspberry Pi's in service / planned to be in service:

    • Two (sometimes three) running on this aircraft:
      • One with a GPS receiver, it provides a WiFi AP for the onboard Ethernet, a DHCP server, and an NTP server that is tightly synchronized to GPS time. I also put together a duplicate of this system for this aircraft.
      • One that runs the dataloggers I wrote in Perl (available here) to log data from multiple sources, the measurement system is a five hole probe combined with an INS and meteorological sensors with the goal of doing Eddy covariance measurements, including methane and CO2 using a separate system. (In fact, this was the system that inspired WebPerl - even if priorities shifted and I didn't get to rewrite the web interface in Perl (-: )
      • We have a third system, not built by me, that we can optionally install and that uses an RPi to control and read out both a multispectral camera and a thermal camera and store the images.
    • I'm working on an RPi that will connect to a datalogger on one of our weather stations in order for us to transmit its data to our servers over a nearby WiFi network.
    • I'm designing a data logger for an in situ CO2 probe that will most likely be running a WiFi AP and hosting a web interface to configure the logger, and view and download the logger data. And I hope to get a chance to use your RPi:: libraries here!
    • Plus of course the various RPi's I have sitting in my lab and at home (RetroPie is great).

    ... and of course I use Perl on all of them, more or less heavily :-)

    Speaking in general, one of the many things I like about Perl is its how tightly it is integrated with *NIX OSes - just look at how many Perl functions mirror the underlying APIs. And one of the things I like about RPi's is that they are basically embedded systems, with many similarities to systems with much smaller microcontrollers, but they in fact are full-fledged Linux systems (the only real caveat being the higher power consumption). In a time where many things are getting abstraction layers (cloud services, JavaScript on the server, REST APIs for everything...), I think the *NIX philosophy is still alive and well in the RPi world. And so IMHO this is a great place for Perl to shine :-)

    Since Raspberry Pi's are aimed at teaching about embedded systems, I think the learning aspect is important. Look at it this way: if we didn't have these libraries for newcomers to simply reach for, then what reason would they have to seriously consider Perl <update> for their hardware interfacing needs? </update> So I think it's great you've made all those modules available! :-)

      That's pretty awesome what you're doing here. I'd love to learn more about some specifics off-line sometime if you're up for it.

      I've also written comms software which I use to communicate with microcontrollers (ESP, Arduino etc etc). Oftentimes, I need much more precise timing than the Pi micro-computer can handle, so I use a controller to perform certain tasks, then either poll or read from the microcontrollers for the data they've accumulated.

      My community has 20 houses on the edge of a lake. Recently, I designed a system that replaced the manual work in the water purification "plant":

      • Arduino Metro:
        • Monitor chlorine mixture tank volumes
        • Monitor various mixture content levels
        • Monitor liquid and plant temperature and other environmental aspects
        • Engage 120v (mains) pumps to fill liquids, with flow-sensors to monitor and ensure the correct mixture of chemicals/h20
        • Manage various water and chemical solenoids to stop/start flow
        • Set emergency and warning flags, and disable parts of the system if issues are detected
      • ESP8266-12E NodeMCU:
        • Is outside of the purification plant house, facing towards a building on my property about 400 metres away. It is attached to the main device that's inside the building via a 30' Cat-6 Ethernet cable. This cable supplies 12v power along with a Tx and Rx serial line
        • It polls the inside unit for all of its data using the serial interface
        • It uses its Wifi connection to a Raspberry Pi on the outside of the building by my house to send all of the data to me
      • Raspberry Pi
        • Is on the side of a building beside my house
        • Is connected via Ethernet to a "dumb" cheap D-Link Wifi-Ethernet bridge
        • Accepts communication from the ESP over Wifi, forces it through the D-Link on another Wifi connection, which I can access from home
        • Responsible for simply sending the data to me

        That sounds pretty cool! And sure, feel free to ask about my systems - a lot of the stuff is already up in the hgpstools repo. For the CO2 logger on my list above, I've been considering combining an Arduino with an RPi, where the Arduino does the data logging and the RPi is only woken up to do the WiFi user interface, to conserve power while it's deployed in the field doing autonomous measurements, but I haven't fully decided on that set-up yet - but now that you mention it, the ESP8266 NodeMCU looks pretty interesting too!

        Do you use any solution to monitor multiple RPi's, i.e. whether they're still on-line and sending data regularly etc? That's an issue I'll probably have to tackle eventually, as the number of RPi's (and other measurement stations) I deploy grows.

Re: Is Perl on the Raspberry Pi worth it?
by jdporter (Paladin) on Jun 17, 2019 at 13:59 UTC

    I've long wanted to get my feet wet with Raspberry Pi, but don't know where/how to start. If I could jump in and bootstrap to Perl, that would make the difference. Maybe people like me can be your audience? People who want to do it but don't know where/how to start?

      Well, first of all, do you have any specific ideas that you'd like to use the Pi for? That's a really good start.

      Your mention of not knowing where to start is a good one; in my docs/FAQ/tutorial, I've got the information, but looking at it from your perspective has made me realize that I need to go further in this aspect, possibly with a quick "get up and going" guide, and a "here's one/two/three very basic projects for beginners".

      Specific thoughts on what you might like to do would be helpful as I said :)

        Everything and nothing? :-) I guess I'd start with something involving home security. Maybe for remotely monitoring events in the home. So it would have to integrate with sensor devices of various kinds. And a camera.

Re: Is Perl on the Raspberry Pi worth it?
by bliako (Monsignor) on Jun 19, 2019 at 07:38 UTC
    ... if it isn't being used by anyone else?

    Along the lines of what I understood GrandFather said: a suggestion would be that in addition to what (great) you are doing, to make (or start a collaboration for) an app using Pi and Perl which is extensible by pluggins. The old art of combining electronics+programming is scarce today IMO, so if you have that skill and can abstract the hardware away, act like the middle-man for more programming-inclined individuals so-to-speak, then you will do us all a favour.

    Here is an idea: modern cars have a socket to suck data out of their electronic system, e.g. fuel remaining, speed etc. (keyword: OBD-II, quick cpan-search: Device::ELM327, intro: https://learn.sparkfun.com/tutorials/getting-started-with-obd-ii/all). So, a Pi kit to interface with the car-can-bus (what a pun) to offer more than a common car-diagnostics tool does (which can be very expensive too) would be interesting: think of the integration to a database, wifi-ing the data home (additionally to BigBrother, gosh). A mechanic could plug that Pi-based diagnostic and the diagnosis goes straight to the car's history DB and prepares a report, or even enquires with online databases about what to do - pretty scary but now this is not our subject. The lighter side of it is logging mileage, fuel and letting you know that "hey you are running out of fuel and the cheapest fuel around here is XYZ"

    Pi+Perl : the whole is greater than the sum

    bw, bliako

      "The old art of combining electronics+programming is scarce today IMO"

      I think it's completely the opposite, it's never been more accessible in terms of affordability or easy of use/low barrier of entry.

        Sure ease-wise yes I agree with you but who does it?

        From personal statistics/experience: I still have to see anyone of the thousands of smartphone users I see everyday to have a DIY extension board with ADC interfacing with an analogue camera or controlling their pet robot or as a TV remote control. I see a lot of apps doing these using what sensors and ports the smartphone already provides, e.g. interfacing phone to bicycle speed and location.I have not seen yet a DIY one. Perhaps I am living in a non-nerdy neighbourhood ;)

        Gone is the time of soldering more memory to computers or making a joystick or a Light_pen (remember that?)

        Edit: forgot the speech synthesizer

Re: Is Perl on the Raspberry Pi worth it?
by davies (Prior) on Jun 19, 2019 at 12:51 UTC

    I'm not afraid of a soldering iron, but I use one only when I need to. I'm an accountant, not a hardware type, and the hardware interfaces of the Pi are fascinating when other people do them, but I don't have the itch to learn enough electronics or low level software to get involved myself. That said, I have four Pis in my home in active use as various servers and a fifth under (software) development. I have another that is effectively my "notebook" computer. Perl is, to me at least, an essential component of all of these. Backup scripts are Perl, and frequently much of the functionality as well. I think the two are a lovely combination.

    Regards,

    John Davies

      Thanks for your feedback davies.

      A few of my friends use Pis for the same reasons you do. I've got one as my main media centre running Retropie. It's got a 2TB hard drive attached and shared across my networks for all of my video libraries, along with several legacy video game emulators. I have one other one in another room as a media centre client.

      I then have one dedicated to doing 24x7 continuous integration unit testing on my RPi::WiringPi and the vast majority of children distributions it manages.

      I've got two for development, an additional one for unit test staging and one running my indoor grow operation (App::RPi::EnvUI). I then have two Raspberry Pi Zero Wifi devices running MotionEyeOS, that backfeed to a central unit as wildlife/security cameras.

      Update: I use Kodi as my core multi-media platform.

Re: Is Perl on the Raspberry Pi worth it?
by 1nickt (Canon) on Jun 17, 2019 at 13:15 UTC
Re: Is Perl on the Raspberry Pi worth it?
by stevieb (Canon) on Jun 22, 2019 at 19:02 UTC

    I've been hit-or-miss the last week or so, so I'm going to go through this thread as soon as I'm done writing this post.

    I'm not going to stop supporting Perl with the Pi stuff I'm doing; far from it. I was just looking for some arbitrary feedback.

    In the last few weeks, I've written the initial draft version of 128x64 pixel OLED display distribution which provides us with the ability to write to these little, ubiquitous and very cheap display screens. I'll be adding different sizes and models in the semi-near future (or sooner if anyone asks for one).

    I also wrote yesterday RPi::SysInfo, that's a part C/XS and part Perl distribution that gathers and returns various system related info from the Pi itself.

    I've compiled all of those new features, along with a couple of other minor changes into RPi::WiringPi v2.3632 which I released this morning.

    This week, I'm going to complete phase two of my unit test hardware platform, and then write a detailed blog post about that process with pictures etc. The test platform has been a fun, entertaining, frustrating and enjoyable experience. Can't wait to write the post about it actually.

Re: Is Perl on the Raspberry Pi worth it?
by FreeBeerReekingMonk (Deacon) on Jun 18, 2019 at 18:08 UTC
    First time I heard of your project. Wanna reach a new generation? And my first question is: Are there any Youtube courses?
      Are there any Youtube courses?

      Why? What do you expect?

      If you want Perl on the Raspi, you probably know Perl. So teaching Perl for the Raspi is quite useless.

      If you want to work with a Raspi, you are probably aware that you will use Linux, and you know your way around. Teaching Linux, perhaps on a Raspi, is pointless, too (in the context of Perl on the Raspi!).

      So, what's left? Some Raspi-specific Perl modules that come with good documentation, as usual. Nothing new for Perl modules. And a few I/O pins that can be controlled by software running on Linux. The latter is a little bit unusual for PC hardware, but absolutely boring on the Raspi. Searching for "raspi pin io" on Youtube yields tons of videos and related searches, explaining more than you ever wanted to know. Searching for the same terms on Google makes that far more than you ever wanted to know.

      All that you have to learn is how to do the exactly the same commands in Perl instead of C, C++, Python, Shell, whatever. That's what you find in the POD.

      See also:


      And by the way: Why a video? Why do you want someone to dictate you how slow or fast you want to learn? Written text, probably with images, can be processed as fast or as slow as you want.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
        And by the way: Why a video?

        Because learning by video is-the-shit. Narrow your gaze to no more than 15°, get into meditational alpha-wave-mode and let stuff sink unfiltered into your subconcious, no questions no frills. And some day you regurgitate what has been settled, and you are enlightened and really know shit. Television learning works! Each day, millions are taking lessions and complete courses successfully for those who air the programs.

        perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

      No, and unless someone else decides to create them, that won't happen.

      Personally, I dislike very much videos on working with electronics and programming. To me it makes absolutely no sense.

      Written user documentation, schematics, breadboard layouts, possibly some images and exceptionally good API documentation is how I approach things.

Re: Is Perl on the Raspberry Pi worth it?
by SankoR (Prior) on Jun 23, 2019 at 00:46 UTC
    I've been busy lately but have used bits and pieces of RPi::WiringPi in several projects. The most public would be RPi::UnicornHatHD which I wrote to scroll position and quote data on a Pi 3 running a basic trading algo. I have a few other unpolished projects... most of those are Perl replacements for the Python based wrappers Pimoroni provides with their other HATs.

      That's awesome!

      I ordered a couple of them for myself. One to play with, the other I'm going to write some tests for after connecting it to my test platform.

      After going through the code, your module uses WiringPi::API, but your cpanfile lists RPi::WiringPi. The latter requires the former, and since I don't see any usage of RPi::WiringPi anywhere in the code, might I recommend that you change your prereq to WiringPi::API instead? The installation of your distribution will go *much* faster if you do this.

      RPi::WiringPi installs a whole slew of sensor, ICs and other peripheral distributions (Perl and XS) that takes quite some time. If you're not using any of the functionality of this encompassing distribution, it's best if you don't require it.

Re: Is Perl on the Raspberry Pi worth it?
by stevieb (Canon) on Jun 22, 2019 at 20:08 UTC

    Addendum to this post...

    If anyone here has a specific issue using my software on the Pi, a request for a new sensor/IC/device be added to it, questions regarding the underlying hardware itself, or questions regarding Perl on the Pi in general (even other Perl-Pi software that isn't mine), feel free to ask here, or me personally. I'm even open to helping others with low-level software (ie C) access to direct hardware registers etc.

    I get these requests periodically via various means, and I'm always willing to help out where I can. Whether it's clarifying documentation (or fixing mistakes in it!), to guiding someone to understand an aspect of the system (that may not even be related to my software whatsoever) all the way to a full-blown implementation of a brand new sensor/IC that I've never run into; I'm up for any of it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://11101452]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-29 13:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found