I'm looking to get in to the wonderful world of RPi. I can make a website with HTML/CSS/JavaScript/PHP so does that give me any kind of advantage over a true RPi newbie?

For my first project I'd like to use a simple pressure sensor and display the information on an LCD screen with a really nice GUI (graphical user interface). I'm obviously hoping to use my web skills to design the GUI and I was also hoping I could use JavaScript - possibly Vue - to program the logic. For example: If sensor reads this value then display this image etc.

I'd really appreciate any help or pointers. Thank you in advance

  • Just had a thought — Would it be a case of just building this as a normal web app, hosting it on something like Heroku and then just pulling in the data from the RPi using some sort of API? – Ben Clarke Jul 22 '19 at 12:12
  • 1
    Welcome to Raspberry Pi :-) Note that we are not a discussion style forum and open ended invitations to brainstorm are not appropriate to the format. Please take the short Tour and visit the Help Center to get an idea how things work here. The Raspberry Pi is a general-purpose computer so it should be possible to do all things you mentioned. – Ingo Jul 22 '19 at 13:19
  • Thanks but my original question is valid — Does my web developer knowledge give me any kind of advantage over a true RPi newbie? I have an understanding of JavaScript and HTML but not Python, C, C++ or Ruby. Therefore I was wondering if I can use JavaScript instead of these? – Ben Clarke Jul 22 '19 at 14:35
  • Yes you can. It will give you advantage over a newbie but not necessarily over a RPi newbie. You are also a RPi newbie, isn't it? – Ingo Jul 22 '19 at 21:37

Yes you can talk to some sensors entirely JavaScript, e.g.

npm install raspi-sensors
npm install node-dht-sensor

That first library was last updated three years ago, so as is typical with the Pi (and Linux) you may deal with some compatibility challenges, while node-dht-sensor was updated two months ago. You can search the npm repository for other modules that may help your cause.

As for the GUI, yes you can write that in Vue.js, open a web browser, and display to the LCD screen.

You didn't mention user interaction, but just in case there's an npm module called pitft-touch, albeit that has not been updated for four years.

A caveat is that sensor- and other peripheral-related libraries on the Pi are generally better supported with Python. If you have experience in both JavaScript and PHP, likely you won't find it that hard to pick up Python where needed.

  • Excellent info - thank you. Following on from your suggestions led me to find the Johnny-Five platform for JavaScript robotics. It seems to have a comprehensive list of robotic components complete with an API for working with all kinds of microcontrollers - all written in JavaScript! Seems to be just what I was looking for so thank you for pointing me in the right direction. – Ben Clarke Jul 23 '19 at 10:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.