Raspberry Pi Camera Module undetectable by common applications - linux

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.

Related

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.

Is it possible to command the Nintendo switch's joy cons with a PC?

I want to create a TAS that can play the Nintendo Switch games that are only compatible with the joy cons.
There are turbo pro controllers in the market but there is no turbo joy cons, so my next idea is one of two:
To use the Bluetooth to connect a devise that I could control with my PC and can be connected to the Nintendo switch via Bluetooth (or USB) and trick it into thinking that it is a joy con and not a pro controller.
Use the idea above but the devise is the joy con itself, in this case, I would have to connect the joy cont to the PC and command it while it is still paired with the Nintendo Switch
Is there any way to achieve what i'm looking for? Thanks in advise.
Also, if there is a better branch in stack-overflow to post this question I will move it.
Looks like it's already been done, and you'll need a product called vJoy.
https://www.pcgamesn.com/nintendo/nintendo-switch-joy-con-pc-guide
Looks like you'd need to reverse engineer the communication protocol used by those controllers and then emulate that protocol with software. Here is a resource I have found regarding RE bluetooth. Another one I have found here. Redfang may help you in that endeavor, it is software that helps you find bluetooth addresses of devices that you you can't discover normally.
Another idea I would have is to open your controller and solder on some wires to a micro controller, such as an Arduino, Raspberry or something similar to the buttons and analogue controllers and 'input' the commands that way.
Unfortunately I can not offer you any more advice. I hope this helps in some way.
One possible way is to use JoyCon Droid app in Android to controll the Nintendo Switch. If this app can work, it should be possible to make one as PC software too.
Luckily, there are a few easy ways to control Android from PC such as using AirDroid which allows you to touch the Android screen from PC. You can refer to How to remote control Android device from a computer with AirDroid?. It can both mirror the screen and give you the touchscreen control, which you can utilize it to control the JoyCon Droid app.
I've just found another way which is to use a microcontroller as a USB controller here.

Rasperry Pi - Control circuit through website

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/

Bluetooth LE from Cordova app to Linux device

I need some guidance. In a nutshell, I need to be able to configure and control a device with the smart phone app over BLE.
For example, change IP address of my Raspberry Pi. To make that happen, I need 2 things.
Simple Android/iOS app that takes IP address parameters as an input, and then communicates over Bluetooth to the RPi. Note that the device needs to be discovered and connected from within the app (without going to "Settings" and pairing).
Build some server process on the Raspberry Pi that listens to USB Bluetooth dongle, receives the command with parameters and acts accordingly.
So I need help building the BLE portion of this project.
I have several years of smartphone app development experience, and 10+ years of Linux system programming. In other words, building a simple Cordova app, as well as Linux process that changes IP address is really not an issue.
However, I am totally new to Bluetooth. Can you point me to the right direction? I am sure this problem has already been solved few thousand times. Is there a tutorial? Or maybe a skeleton code I use as a starting point? Also, any recommendation for BLE USB dongle?
Thanks a lot!
I think it will be harder to find a better guide to implement low energy technology on the RaspberryPi than this one :
https://learn.adafruit.com/downloads/pdf/pibeacon-ibeacon-with-a-raspberry-pi.pdf
After this , you can download a random app on the Playstore/Appstore and check that your RaspberryPi is actually acting as a BLE device.
Finally you can start creating your own app using several available BLE plugins like :
https://github.com/randdusing/BluetoothLE
https://github.com/don/cordova-plugin-ble-central

Simple Universal Plug and Play ( uPNP ) to find Raspberry Pi on Network

I have a RaspberryPi connected to my home network via WiFi with a dynamic ip address. I then have my iPhone connected to the same network also via WiFi. The Pi has a lightweight c++ HTTP server running on it that can execute commands. I now want to write an Objective-C app that can find the Pi on the network, regardless of it's ip address, and send it commands. So, Universal Plug and Play seems like the logical solution - but everything I find on Google is dealing with Media players and streaming audio/video content.
I just want the Pi to somehow simply broadcast on my network - "Hey, I'm RasberryPi and my IP Address is 192.168.0.5!".
Can somebody please suggest a package or solution to this problem? Thanks!
For the RPi side I would suggest GUPnP as long as you can fulfill the dependency requirements. It's a very modular framework so you don't need to load or use any of the multimedia related things if you don't need them. It's based on glib and libsoup and allows you to fairly easily define and implement your own UPnP services. Take a look at the BinaryLight example: It implements a BinaryLight Device that contains a SwitchPower service with several methods and two state variables (properties). You should be able to hit the ground running if you start with that. There's documentation on how to write a server.
The components you are going to need/want:
libgssdp, handles discovery, used by gupnp
libgupnp, the actual upnp implementation, used by your app
the dependencies (glib, gio, gmodule, libsoup, libxml)
Also possibly for testing (this on a desktop linux machine since it requires gtk):
gupnp-tools, contains gupnp-universal-cp
EDIT: If you really don't want to implement any UPnP functionality, it's possible you could just use GSSDP for the IP discovery. This could be very simple: see test-publish example.

Resources