Okay, so not strictly a programming question BUT the point is I want to integrate my new building's business access/alarm system into the rest of my *NIX setup at my business. I do NOT want to use some cruddy windows GUI program written for Windows XP SP1 that manages a bare circuit-board via a serial connection and provides absolutely zero APIs. There's got to be something decent out there!
Any decent access/alarm hardware vendors out there? I'd love to interface via python, perl, ruby, etc. to some nice control panel that has an integrated NIC. Heck, I'd even settle for some CLI tool that I could at least exec and parse.
We've got mag card readers on doors/elevators, mag locks, rex's, fingerprint readers, etc. for our access.
We've got standard door/window, motion, etc. for our alarm.
Hardware vendor suggestions?
What is you physical location? If europe you could have a look at EIB-Technologies. Just google for EIB and you'll see many answers for your question. EIB stands for European Installation Bus. It is a technology used for controlling almost everything in buildings (light, alarms, aircon, etc...) using a bus and centralized control centers. Depending on technology providers you'll also have interfaces to *nix systems.
have a look at e.g. link text
Does this answer your question?
What do you actually want to do with your integrated system?
Two of my former employers developed access control systems, both running on Windows. Both provided a programmatic API (DCOM or TCP socket.) *NIX support was another matter, but you avoid the hardware interfacing problem, at least.
One was Honeywell, but that's designed for big systems and will probably be out of your price (and complexity) range. The other (a small startup) doesn't support all of the devices you list.
If your building wiring is RS485, you're unlikely to be allowed to interface over that. Ethernet to the access control software is your best bet.
Ethernet-connected devices have traditionally been uncommon as the configuration is tricky; your typical alarm installer doesn't know about IP addresses, subnets, switches and whatnot.
I suppose the way to go will be DPWS; as Windows provides built-in support for this now, you can expect hardware vendors to jump on the bandwagon.
I ended up finding some good hardware by eData that was run off of embedded Linux with ssh, SOAP, REST, and Web GUI access. Unfortunately the integrator bid way too high and wouldn't commit to working in our time frame, so we ended up with the crappy Kantech stuff. Yay serial cables. :-(
Related
I'm making an IOT project for home automation, including a dozen of Rpi Zero-W using Strech-Lite operating syste, to control and report its Sensor and/ or relay's status.
I believe a ESP32 Ebay link would be much more reliable since it is a controller running code rather that a whole operating system as my current solution ( By the way micro:bit does not qualify since it lacks wifi ).
My question is - can I use gpiozero library ? since my code is based on it
classes supported in MicroPython here
Until now I have developed several programs to use in my Raspberry Rpi2 and RPi3 as BLE perifpherals using bleno.
Can anyone tell me if there is something alternative to Bleno, in Python or even better in C, to develop a code for a BLE peripherals service for my Raspberry?
I've had this same pain as you - trying to get a good BLE Peripheral role library for python - so I went ahead and ported Bleno to python2/3.
It's still a WIP, but the Echo demo works just fine.
https://github.com/Adam-Langley/pybleno/
And it's on pypi as "pybleno"
Of course, a big shout out to Sandeep Mistry for the fantastic original node codebase.
Hopefully people find it useful.
Well you can always use the HCI_CHANNEL_USER feature in Linux to talk to the Bluetooth controller directly (from C for example). In fact that's exactly what bleno does. Just follow the HCI protocol in the Bluetooth specification.
I can't give you answers for C, but bluepy seems to be the best in breed for speaking to BLE peripherals (as bleno does) right now, and if you want to use core mode, there's Adafruit's BlueFruit LE.
Caveat: I'm only getting my feet wet with Pi peripherals myself and don't have any successful projects with either of these yet.
There isn't a library written in C as far as I know, but here's an interesting place to start:
https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/ (especially interesting are: doc/mgmt-api.txt, doc/gatt-api.txt for LE things)
There seem to be two interfaces to do Bluetooth stuff: D-Bus and HCI sockets.
HCI sockets are actual C socket()s with the special AF_BLUETOOTH domain (http://man7.org/linux/man-pages/man2/socket.2.html is kind of helpful for explaining this).
And you can use org.bluez.* for higher-level interfacing using D-Bus.
Getting all of that to work would be probably a nightmare, and all of the other Python libraries probably work fine. If you want higher performance, you could totally get something to work in C or Rust, and all you should need is sockets and D-Bus, it just sounds really really hard.
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/
I have both Fruityloops and Propellerheads Reason software synths on my Windows PC.
Any way I can get at and script these from either Visual Basic or Python? Or at least send Midi messages to the synths from code?
Update : attempts to use something like a "midi-mapper" (thanks for link MusiGenesis) don't seem to work. I don't think Reason or FL Studio act like standard GM Midi synths.
Update 2 : If you're interested in this question, check out this too.
Both applications support MIDI. It's just that they don't see each other.
In order to send messages via MIDI between applications, you need to install a virtual midi port.
There are several freely available, but this one works: http://www.midiox.com/zip/MidiYokeSetup.msi
You'll get a virtual MIDI output port that you can write to as if it's a normal MIDI device. In Fruity Loops or Rebirth you choose that port as the input. That's all you need to do to connect the programs.
It'll work like this:
Your Application --> Virtual MIDI Port --> FruityLoops
Note: This answer doesn't exactly answer the question you asked but it might achieve the result you want :)
You can author a VST plugin in Java using jVSTWrapper (http://jvstwrapper.sourceforge.net/). If you really wanted to use Python you could use Jython to interface to java and do it that way. Alternatively you could just write the plugin in Java or another scripting language for the JVM like Groovy.
I think both FL Studio and Reason can be configured as the default MIDI playback device. To send MIDI messages to either from VB.NET, you'll need to PInvoke the midiOutOpen, midiOutShortMsg and midiOutClose API calls. Here's a link to code samples:
http://www.answers.com/topic/midioutopen
They're for VB6, but they should be easy to translate to VB.NET.
I know FL Studio can be "driven" from a plugin authored for FL (or a VSTx plugin), but I think these are always written in C or C++.
Edit: I just learned that Windows Vista dropped the MIDI Mapper (which would have made setting up FL or Reason as the default MIDI device simple). Amazing. Here is a link I found with an alternative solution:
http://akkordwechsel.de/15-windows-vista-und-der-midi-mapper/
I just tried it out (it's just a *.CPL file that you double-click to run) and it appears to work (although the GM Synth is the only option available on my laptop, so I'm not sure if it will pick up FL or Reason as choices).
What you need is a VST MIDI scripter / scripting plugin to create a logic of MIDI events that can be sent to any MIDI channel. You would need to set a MIDI channel in FL for the VST instrument/effect you need to tweak its values. Google for it there are some plugins around and please share them back here if you find anything useful :)
You could write a Rewire host. Though, you will have to get a license (the license is free, but your application must be proprietary, so no open source).
Alternatively, you could interface through MIDI messages.
Finally, you could implement a dummy audio device which would route the audio to/from wherever you want or process it in some way.
I imagine all of these would be reasonably difficult. MIDI is probably the easiest of the three (I have no idea how easy or hard the Rewire protocol is to use).
When it comes to Reason, you can do with it to much because of it's closed architecture - you can use VST plugins (or any other type like DirectX ones) - your only option is to use MIDI.
Regarding Fruity Loops, you could write a VST plugin that can take an input from a scripting language (VB, Python or whatever) but in order to write such thing you would have to use Delphi or C++.
Alternatively, you can check out MAX made by Cycling74 - it's something like a IDE for music ;-) - and I'm pretty sure you can use Python with it.
There's an opensource music workstation, called Frinika, and you can script that in Javascript. (Insert / delete notes , change midi effects like pitch wheel etc.) It can import / export regular midi files, so it will work with Fruity loops or whatever else you have.
// Insert New
song.newLane("MyMidiLane", type("Midi"));
lane = song.getLane("MyMidiLane");
part = lane.newPart( time("10.0:000"), time("4.0:000") );
part.insertNote(note("c#3"), time("11.2:000"), time("2:0"), 120 );
part.insertNote(note("f3"), time("11.3:000"), time("1:0"), 100 );
part.insertNote(note("g#3"), time("11.3:000"), time("1:0"), 100 );
part.insertNote(note("b3"), time("11.3:000"), time("0:64"), 100 );
part.removeNote(note("f3"), time("11.3:000"));
part = song.newLane("MyTextLane",
type("Text")).newPart(time("24.0:000"), time("10.0:000"));
part.text = "This is the test text to be inserted.";
part.lane.parts[0].remove(); // remove initially inserted text-part
Another example for reading/changing notes:
lane = song.getLane("MyMidiLane");
// a lane has a fixed instrument assigned
lane.parts[0].notes[0].duration=64
lane.parts[0].notes[1].duration=32
lane.parts[0].notes[1].startTick=120
// Parts are blocks of notes that you can drag around together in the Frinika GUI.
// They're like patterns in trackers.
for (i in lane.parts[0].notes){
println("i: "+i+", n: "+noteName(lane.parts[0].notes[i].note));
println("i: "+i+", dur: "+lane.parts[0].notes[i].duration);
println("i: "+i+", startT: "+lane.parts[0].notes[i].startTick);
}
http://frinika.appspot.com/
It has a Java Webstart launcher as well, so you don't even have to
install.
It used to bundle the Javadoc documentation as well, but for some
reason their latest downloads don't include that. It's a pity, because
that's where the Javascript bindings are documented. So, now you have
to browse the source or build the Javadoc yourself. (It has some built-in examples that are accessible from the scripting window, you should check them out first. My first example is from there.)
Here is the sourcefile where you'll find the Javascript docs:
frinika Javascript doc/source
But there are other options as well. You can check out mingus too, which is a Python library for music theory and midi file handling. It requires Fluidsynth, and the demo apps require GamePython too, so it's a bit more complicated to setup than Frinika.
P.S.:
Frinika has a particular bug: when dragging around neighbouring notes, some might not sound the right length. You can help that by transposing forth and back the consecutive notes (fairly fast in piano roll view), or dragging the part that contains the notes forth and back. Restarting Frinika will also help, but that's the slower way. So this bug won't affect saved files, neither midi export.
Is there a way to accept input from more than one mouse separately? I'm interested in making a multi-user application and I thought it would be great if I could have 2 or more users holding wireless mice each interacting with the app individually with a separate mouse arrow.
Is this something I should try to farm out to some other application/driver/os_magic? or is there a library I can use to accomplish this? Language isn't a HUGE deal, but C, C++, and Python are preferrable.
Thanks :)
edit:
Found this multi-pointer toolkit for linux (it's actually a multi-pointer x server):
http://wearables.unisa.edu.au/mpx/
You could try the Microsoft Windows MultiPoint Software Development Kit 1.1
or the new
Microsoft Windows MultiPoint Software Development Kit 1.5
and the main Microsoft Multipoint site
Yes. I know of at least one program that does this, KidPad. I think it's written in Java and was developed by Juan Pablo Hourcade, now at the University of Iowa. You'd have to ask him how it was implemented.
http://code.google.com/p/pymultimouse/ is a library using windows raw input, it worked in a test with 2 mice.
You could use DirectInput with C/C++ (there's probably also bindings in other languages). You use IDirectInput8::EnumDevices() (using DX8; same function, different interface in other versions of DirectX) to get a list of all attached devices. Then, you create the devices and poll them IDirectInputDevice8::Poll(). This should almost definitely work with any number of mice, keyboards, and other input devices. MSDN has really good documentation on this.
I have this vague feeling that BeOS used to let one pair a mouse and keyboard and have separate active windows and inputs. Wow... that was a long time ago. I thought that it would be very interesting for "paired" programming.
See my answer here (avoid the JNI stuff): How can I handle multiple mouse inputs in Java?