Control PWR Led on Raspberry 3 - python

I read quite a few articels that say that the power led is now hardwired on
a raspy 3 device but some say it is somehow possible (but do not give specific
answers).
My question(s):
1.) is it possible to control the led via python and how.
2.) if not then can I permanently disable it?

The power LED is now also acting as a low-voltage indicator now. It is possible (however not trivial) to use it as an output but then the low-voltage indicaton is not working anymore. If I understand it correctly, the devs need to come up with a solution, so not much "normal" users can do for now.
There is an open issue on their bugtracker where you can get a bit more info: https://github.com/raspberrypi/linux/issues/1332
In general, as soon as the devs make it possible to control the power LED, there should be a file named /boot/overlays/pi3-pwr-led.dtbo. Currently, there isn't.
You can also have a look at one of the bare-metal environments and see if they have come up with a work-around.
https://github.com/rsta2/circle
https://github.com/vanvught/rpidmx512

Related

Beagle Bone 128x64 Graphic LCD

I have a BeagleBoneBlack and im trying to find a way to control a 128x64 Graphic LCD using python(This display, more specifically http://www.newhavendisplay.com/specs/NHD-12864AZ-NSW-BBW-TR.pdf), and i dont know exactly how to do it.
Last time that i used this display i was working with a PIC16F877A using the MikroC compiler and it has a library specifically for this GLCD display so it was bearly easier. I searched superficially for some solution but i dont find anything, do you guys know some solution or i have to create my own library to this application?
It looks like you should be able to get something working quickly based on the Linux Kernel FBTFT driver subsystem.
Latest upstream sources show a quite wide range of supported displays. At a cursory look the controller seems to be part of the KS0108 family:
KS0107B / KS0108B; S6B0107B / S6B0108A; HD61203 / HD61202; AX6108 / AX6107; PT6608 / PT6607; SBN0064 / SBN6400; KS0708; S6B0708; ST7548; ST7588; NT7108; RA8808; RW1065; and equivalents.
Please note that by default the beagleboard.org Debian images come with an older kernel. At least it looks like the 4.14-ti kernel build config does enable FBTFT as a module. So if you're really lucky it might even work out of the box. Though I'd be prepared to rebuild the kernel.
Feel free to ask me to expand on certain aspects of the above. This is a high level view with some pointers right now.

How to read a tag from PN532 in Python?

I want to experiment with the PN532 that comes connected with an arduino UNO. I have never touched anything similar, and in fact it took me quite a few tries to be able to play with LEDs on another arduino board I have.
Can someone provide me with a concrete example of reading data from the pn532 when I use a tag or card on it in Python?
Take a look at https://github.com/HubCityLabs/py532lib. The standard library is in C, somebody wrote a Python wrapper for the C library that you can use.
I did found a way that might be partially correct. Since Eugenes' answer does not provide a definitive way that we know will work, it cannot be considered a full answer so I will most probably accept this one if nothing else changes.
First of all since the PN532 does not continuously monitor for signals and emits data, we will have to program it the usual way in order for it to behave according to what we want to achieve.
This can be done using the same software that you program any other Arduino device.
Make sure you have chosen the correct port from the tools menu. If you don't know which port is that, in windows go to Start>All Programs>Accessories>System Tools>System Information>Components>Ports>Serial. For Linux going to /dev/serial/by-id should do.
Then I would recommend using the examples provided by the manufacturer here. Make sure you choose the right connection type or else you will see no data coming from the device (Most probably you will want I2C).
Once that is done, and your device emits data each time a tag is used on it (check with a serial terminal configured at 115200 Baud rate) then you are ready to start working with python.
Again I recommend this module to read your data from the serial port. It even comes with a ready to use example of a wxWidgets terminal to read your data from the PN532. If of curse you use another python library and you think its better do say so in the comments.

Using a Raspberry Pi to create Usb-to-multiple 3.5mm converter?

I'm excited. I'm a long-time lurker here at SO, but I've never posted. Here goes!
I'm trying to develop a device that would connect to a host RPi through (preferably) USB, and would have multiple 3.5mm jack outputs. The goal, ultimately, is to get the device to use a standalone program that, when a button is pressed (keyboard, or other external input), a specific sound (or set of sounds) would go through a single 3.5mm output. Now, I understand that there's going to (most likely) have to be an external box, and I also realize that I'm in above my head, but I'm trying to create this as more of a hobby and as a learning experience.
Basically, the way it would go is that the user would set which inputs triggered which outputs beforehand on the custom software in the RPi. The input would then trigger that ouput then await a new signal. I figure I'm going to need to also build a physical box to house the amount of 3.5mm jacks I want (i figured 3-5.)
So, where do I need to start? I don't need a guide on how to do this, more of a step in the right direction. From what I can discern, there's not anything out there that does this. If there is, please show me and I'll get that instead. I've done a lot of googling on this, and I'm thinking that I'll use Raspbian on the Rpi, and code the software using Python. I know I'll also need to build a driver so that the external box and the RPi can communicate. Lastly, I assume that I'll need some type of circuitry for the external box. That's where it gets hairy to me. I've never dealt in physical I/O except for a bit of modding. Where would I start my search there?
Any help at all is appreciated, and thanks for reading this huge post. Thanks!!!!!!!!!!!!

Using python to control a phone with bluetooth

I would like to know if there are any API's for python to programmatically control a phone, like starting and ending calls, but also to record conversations.
I would also like to use the Headphones and Mic of the computer to talk over the phone.
Any info would be great, I tried googling for something, but nothing useful came up.
Be careful when using PyBluez! The results will actually depend on the BT-USB dongle you are using. Depending on the hardware(the BT chip in there), PyBluez will use one or another BT stack - for example there was one from WIDCOMM. Results will vary, as PyBluez is actually wrapping around those stacks - all of which are far from complete.
So, when you have a working project, be sure to know what actual BT stack you were using :)
For Python audio stuff, you could try this.
PyBluez is an effort to create python wrappers around system Bluetooth resources to allow Python developers to easily and quickly create Bluetooth applications.
Unfortunately I've not found a page dedicated to its features, but it could be a good starting point, whether everything you need is in its feature set, or if you could build your application upon it by extending it.
http://code.google.com/p/pybluez/

Python GPIB commands

I have a working GPIB interface and Linux-GPIB package installed and working.
I only know two commands at the moment, x.write and x.find. I don't know much about Python, but I recognize the dot operator and realize that after importing gpib, I should get some functions at my disposal.
I have not been able to locate the list of GPIB functions.
They are in the gpib library. You reference them like so: gpib.foo().
Add this line into your code:
help(gpib)
And browse through the functions/classes.
If you are working in Python, I think the pyvisa is what you are looking for. It provides lots of useful high level functions which helps you to send a series of SCPI commands to your equipment via GPIB, such as write, read,ask and so on.
As for SCPI commands themselves, usually they will differ from the different vendors. So in terms of what kind of SCPI you should send to the equipment, you should read the corresponding datasheet. But in the other case, you could have installed the drivers which were provided by the vendor. In this case you can send some even higher commands. For instance, if you would like to control a voltage source, they have probably already got the function setvoltage(double voltage). Things will be much more easier for you.
Actually there are many commands available. Except those two you mentioned, there are x.read, x.ask, x.ask_for_value and so on.
But I recommend your to read those help file, I think that will give you a better understanding.

Categories

Resources