Rasperry Pi - Control circuit through website - web

I got my Raspberry Pi 3 quite recently and have made some basic projects. I'm looking for a method to create a website (on my laptop) and control my raspberry pi through that - well, more just a circuit attached to it. Would that be possible? If so, how would I approach it?

Depending on the language you want to use for the project, you will want to find a gpio library to control the GPIO pins. You would then want to wrap the calls in a webserver. Some examples of the libraries:
https://pypi.python.org/pypi/RPi.GPIO
https://www.npmjs.com/package/pi-gpio
http://wiringpi.com/

Related

Raspberry Pi Camera Module undetectable by common applications

I bought a 5 mp camera module available at Amazon for my raspberry pi 4 2 gb model. Then I configured it for use and tested it with raspistill and raspivid, it is working as expected. But since it is a module connected to the CSI port and not a USB camera its is not detectable by some common applications. For eg.:- OBS(From Pi-Apps), Zoom(From PI-Apps, Pi-Kiss and its web portal).
What I tried ? --
Virtual camera through OBS. I was able to install OBS but I wasn't able to compile
its plugin for virtual camera and camera module. It had numerous errors.
IP camera adapter :- Idea was to stream the camera feed on local web and then convert the feed to a virtual camera. Yes, there are many such applications but all are available only for windows/Mac and not for Linux. Even the few, which are available doesn't support Raspberry pi's architecture.
Is there any workaround or a trick for make the module work like a normal camera ?
P.S.:- If you are wondering why the question is on Stackoverflow,then I feel this is a software related question and Stackoverflow is the best for that ;).
Have you tried looking into libcamera?
https://www.arducam.com/docs/cameras-for-raspberry-pi/raspberry-pi-libcamera-guide/
That might not be the best, straight-forward answer you're looking for, but I recently did some work with a PiCam and found libcamera to work wonders. I used it on a fairly low level and didn't try to point it to additional programs, but perhaps you can find something useful in there! Good luck.

Does .Net Core 3.1 have an event driven method of detecting GPIO pin changes?

I'm creating a .Net Core 3.1 console app to read to and write from GPIO pins on an Orange Pi Zero (similar to a Raspberry Pi Zero). It is running Armbian Focal (Ubuntu). I'm using .Net Core's System.Device.Gpio library.
I have managed to get the reading to and writing from the GPIO pins working - no problem. But the way I am reading the pins is by doing a gpioController.Read() inside a loop. I was wondering if System.Device.Gpio has an event driven method of reading a GPIO pin? In other words, if a pin goes from high to low, or low to high, that an event - let's call it "gpioPinStateChanged" - is triggered. Is there such a thing?
I know I could create my own even notification system, but I was wondering if .Net Core perhaps had something built in? I've looked at a dozen code samples, and none of them have anything like that, so I'm guessing there isn't...
Thanks
Following 0andriy's comments, I saw that you can indeed register events to detect GPIO pin state changes. Thanks to his post, I also found another great post of someone doing the same. He uses GPIO pin change events to calculate the RPM of a fan.
http://blog.timwheeler.io/building-a-pwm-fan-controller-with-dotnet-iot/

Raspberry Pi Home Security System - Request for Guidance

I had a quick opinion question regarding a Raspberry Pi/Python based home security system I'm working on. My end goal is to have magnetic door/window sensors being monitored by a Raspberry Pi 4 server. If a window or door is opened while the system is armed it will play an alarm sound to the connected speakers. I would then have Raspberry Pi Zero W powered keypad panels (with LCD screens and a 12 digit keypad) that would allow me to see whether the system is armed or disarmed and allow me to input the passcode to arm or disarm the system. The Raspberry Pi Zero W panels would connect to the Raspberry Pi 4 server over the network.
I already have a somewhat functional test system running in a single Python script with everything connected to the Raspberry Pi 4 (link below). However, I'm now at a point where I need to figure out how to tie in the Raspberry Pi Zero W keypad panels I would like to integrate over the network. My question for you all is how would you go about implementing the network connectivity portion of this? Should I use something like Node.js with some kind of database? Perhaps the socket module in Python for something low-level? Something else entirely?
I'm up for any and all suggestions for how to go about this. Please let me know if you have any questions. Thanks in advance!
Poorly Done Diagram: https://imgur.com/a/AnAVzLt
Current Working Code: https://github.com/kevbo423/RPHSP/blob/master/Home_Security_System.py
If this was me, As you have the power of a full fat Pi 4, I would use a PHP web server on the "server" Pi that the other nodes POST to. This will give you the benefit of not having to deal with low level networking. You could also potentially add further devices or web services in the future with more integration opportunities.
You would then need to interface python to the PHP server however this could be done with a simple text file or alike.

Reading Bluetooth data and command (Raspberry pi 3)

I am currently working on a project that make me control media center and a few domotic parts in my living room.
I have connected on my raspberry pi 3 a NAS, my Spotify account (with hifiberry, controls to close my amp, my PC and a few lights...
At first to control it all I programmed a web server that I can access on my phone. That made the job but it is not completely user friendly since I have to have my phone go to the interface and do whatever I have to... And I'm not a web designer 😁 it's far from perfect!
I've made some research and I have decided to build a bluetooth remote control (raspberry pi 3 do have Bluetooth low energy).
Since nothing exist as I want, it is going to be a custom one made with Arduino mini and hm10 module.
But I'm stuck on the raspberry part!
How can I read the Bluetooth data send by my remote and launch scripts according to the command sent?
Via a serial listener of some kind?
Yes, in fact, you should use a serial port to connect your pi with Bluetooth module.
You then use software input information for your purposes, but you must first implement the hardware and hardware interface first.
You can build application software with the Python programming language.

wireless transfer of data from raspberry pi 3 to pc using python

I am doing my master thesis and one of the important things for me is to transfer the recordings of pressure and temperature from a patient simulator to a PC. From the sensors, the information is taken by the raspberry pi3. I am using raspberry pi3 because it has inbuilt wifi option. Now I have to transfer the data from the raspberry pi to the PC wirelessly using python programming. I am new to python and I have absolutely no idea how to do this. Could anyone help me with writing the code so that I could at least send some data from where I could adjust the bit rate and other things according to my requirements?
Take a look at sockets, a simple client - server communication is really easy to do :)
https://wiki.python.org/moin/TcpCommunication

Resources