How can we direct a Amazon Echo intent to a private/internal https endpoint? Like a raspberry pi running nodeJS.
Using an "Echo Proxy" still requires to have the service accessible from internet (More on Echo Proxy: https://www.reddit.com/r/amazonecho/comments/3blkax/alexa_api_proxy_java/ )
Using "HUE Bridge Emulator" will help you fork the Alexa request to a private(internal only) https server. However, this setup limits usage of Alexa intents to "Turn on" or "Turn off" (and set dim level etc). (More on HUE Bridge Emulator: https://github.com/armzilla/amazon-echo-ha-bridge )
I would love to hear feedback on how can we work around this problem.
EDIT: I now have a stable, working setup of my Pi controlled by Amazon Echo. And this is how it is configured:
Setup AWS Lambda to handle incoming intents from Echo
On Lambda, map a "ACTION KEYWORD" for each intent/slot
On a matching intent/slot, post the ACTION KEYWORD to PubNub channel
Setup my Pi to SUBSCRIBE to PubNub channel for new messages
If Pi receives a matching ACTION KEYWORD on the channel, it triggers a function/script
This function/script in turn has the complete execution logic (example: Open garage door)
I'd love to hear feedback on this method and leaving the question open for others to post simpler/better way to achieve this
Another way is to use a service like dataplicity.com. This gives you a url to access your Pi. I use it with Node-RED to have multiple endpoints that I can access from anywhere for my Alexa Skills as well as my chatbots.
This is a relatively old question, but if you'd like to use Alexa to send commands to a local accessory and you don't mind a Bluetooth or BLE connection between the Pi and your Echo device, you might want to take a look at Alexa Gadgets Toolkit (AGT): https://developer.amazon.com/en-US/docs/alexa/alexa-gadgets-toolkit/understand-alexa-gadgets-toolkit.html
With AGT you can setup a Raspberry Pi as a gadget, which is a connected accessory, that you can control through custom directives from a custom skill. There is also support for the gadget to send events to the skill but only while the skill is running.
There are samples on GitHub that should help you turn a Raspberry Pi into an Alexa Gadget with minimal effort: https://github.com/alexa/Alexa-Gadgets-Raspberry-Pi-Samples
You might want to follow this tutorial: https://github.com/alexa/Alexa-Gadgets-Raspberry-Pi-Samples/tree/master/src/examples/color_cycler that has bi-directional communication capabilities between a gadget and a custom skill.
Related
I am a beginner with raspberry pi 4 and I would appreciate any help.
I am making a simple project in .net – basically I have a web APi service which should read raspberry Pi device sensor’s indications. I have read that the simplest communication between my Web APi service and the raspberry Pi sensors is setting up an MQTT broker to act as an IOT server
Have somebody tried this and is it a simple process. Also is this a simple code, should I write the commands in Python. I saw that most people use mosquito as it is easy to install on Pi.https://mosquitto.org/. In my web APi c# project I will use an MQTT library to send (publish) AND RECEIVE messages(the sensor indications) to that broker. The question is – would it be hard to send this sensor's information from the Raspberry to the broker with the sensor indications.
Thank you so much.
I think your question is fragmented:
What sensors are you reading?
Do you need mosquitto? Depending on what you want to do, frequency of calls, concerns about transport performance or payload size etc. You may or may not require an MQTT broker, in the case that you need one, you can build one in .Net with MQTTnet or similar.
You say you're starting out but you have or know how to build a .Net Web API, in that case I say stick to what you know and decide if you want to go the mosquitto route later.
If you have a .Net Web API, you can write python requests against your .Net Web API.
That's easy-peasy as python isn't hard to get started with.
If you want to stick to .Net and you are more comfortable with it, explore Mono or run VS Code https://www.hanselman.com/blog/HowToInstallVisualStudioCodeOnARaspberryPi4InMinutes.aspx and some have even loaded .Net Core.
At your own risk you can even explore experimental options like Windows 10 Arm and Windows IOT Core as options, then you should be able to run .Net apps on them.
In your case you definitely don't need mosquito/mqtt transport. The delay is long enough to just use your regular .Net Web API.
Combine the following tutorials:
https://pimylifeup.com/raspberry-pi-humidity-sensor-dht22/
https://www.w3schools.com/python/module_requests.asp
Ideally you want to post the data but for example sake here is a get request.
Python example:
x = requests.get('http://localhost:5000/api/raspberrypi?sensorId=1&temperature=22.5&humidity=34')
Your .Net Web Api Endpoint:
public async Task<IHttpActionResult> Get(int sensorId, double temperature, double humidity)
{
var timeStamp = DateTime.Now; //Date & Time of receiving reading.
// Your save code here
}
Note, I included a field for sensorId in case you have several sensors sharing the controller.
My dad wants me to make kind of a smart home.
I would like to interface with KNX (a home automation protocol) using the GPIO on a Raspberry Pi 3. Ideally, I would like to build a web interface for it, but I don't have a clue how to interface with KNX in the first place.
Any suggestions?
It wont make sense for you to interpret and understand the KNX bus communication protocol directly. There is a massive specification behind the KNX bus which deals with so many problems from device addresses to collision detection. It would take years to master it and unless you develop KNX devices you really should not spend your time on it. You will be better off by doing the following:
Buy a KNX/IP gateway/interface such as https://www.mdt.de/en/products/product-detail/system-devices/system-devices/ip-interface.html
Understand that KNX bus traffic can be routed/tunneled to your home LAN/WIFI
Play around with one of the KNX libraries on GitHub. For example for C#: https://github.com/search?l=C%23&q=knx&type=Repositories&utf8=%E2%9C%93
If you want, have a look at my experimental .NET Core project which starts a radio streaming process when someone touches a button (in the bathroom in my case). It runs on any operation system (so Raspberry and Linux are fine) and you can find it here: https://github.com/ThomasZeman/KnxNetCore
check this website : http://michlstechblog.info/blog/raspberry-pi-eibknx-ip-gateway-and-router-with-knxd/ that might help. also there are special knx 2 ip devices sold by electronic stores
You can't connect the KNX bus to anything on the pi. The KNX bus has its own electrical specs, and you need specialized hardware to connect to it.
Such hardware is available, but probably a KNXnet/IP device (such as the Siemens N148) is a better option.
I see two options for you:
A) use an IP interface (e.g. the ones from MDT) and access the IP interface from your raspberryPi (e.g. with http://calimero-project.github.io/)
B) use a TPUART controller, which makes KNX TP telegrams accessible (r/w) to UART - see http://www.konnekting.de/konnekting-lernen/l1-knx-mit-arduino/
I am trying to set up a wireless 'test' box to use on a private club (11,000 acres). The initial tests won't need anything fancy, it will just be checking the visibility of a hotspot from a high-point in the middle of the property. But if it proves to have good visibility, later tests will be (hopefully) promoted by the club and made aware to members. I would like to set up a captive portal to redirect them to a comments page where they can post a quick message if they were able to connect and hopefully say what they think about the idea.
This is going to be going on a raspberry pi running debian wheezy. So the less overhead the better.
Most of the examples I see online of captive portal are based on having an internet connection and/or a NAT scheme set up. I just need a hotspot and a single web-page for these promotional tests. If possible, I would like to trigger any devices capable to suggest or otherwise open a browser to go to the promotional landing page. It would also be nice if some kind of dns masquerading or other mechanism was in place to redirect all browser traffic in the event their device doesn't support a pop-up.
Any help is appreciated.
EDIT 2022/06/05: With further testing and packet sniffing, it turned out that the android versions in question hard code the ip of the google server used for the 'online check' (8.8.8.8). When on an arbitrary IP, it's not looking for requests to 8.8.8.8 and thus it doesn't grab the online-check and won't redirect. If you set the AP to use this address (when not internet connected), the pop-up will usually trigger.
However, this solution is not ideal. Hacking the IP stack to specifically grab that request to 8.8.8.8 is outside my wheelhouse of knowledge. If anyone knows how to do this or has another potential solution, I would be interested in hearing it.
I want to start an IoT project with multiple machines (i.e., Raspberry Pis) in different locations (i.e., throughout a city or several cities).
Each machine should be able to send data to a back-end (ex., alive ping, sensor read-out updates, etc.) or receive orders from a back-end and send back response.
I don't want to start from scratch (can't use Amazon or Azure IoT service) - is there a framework that would do this (can register to the service and allow me to check which machines are up/down, send them messages, etc.)? I would prefer open-source possibilities, if possible.
For seeing what's going on with all those devices, and notification of problems, and automating any processes, then DevicePilot is worth a look. It's not an IoT platform though (there are plenty of those).
Cumulocity offers a complete Software-as-a-service to do that.
Raspberry Pi integration is described here:
http://www.cumulocity.com/guides/devices/raspberry-pi/ (Java Agent)
or here:
http://www.cumulocity.com/guides/devices/janztec/ (C++ Agent)
The agents are open source (under https://bitbucket.org/m2m/ ), the server-side platform is not open source (except examples). But you can get a free trial (see http://www.cumulocity.com/ ).
On
It would work like that: upon start, raspberry would register to the service, once done, the service allow me to check which machines are up / down, send them messages etc.
This is supported out of the box without programming. Please see links above.
Stefan (working for Cumulocity)
I found this article:
www.codeproject.com/Articles/1077937/Possible-ways-to-organize-interaction-between-co,
and I know that there exist a code for the flash player.
Can I use only code for managing connections (as in the articles examples) and free flash player code and therefore get rid from integration software?
You need to be more specific but in reality the idea of the integration software is the following:
Session management
Multi-codec/format support
Interface Resource
Scheduling
Normally IP PBX supports SIP only, hence you need the transcoding between the SIP world (Audio + Video) and the Webcast world (Web browser/client/camera). Integration software as the one defined do a pretty good job and some of them are open Source (Wooza), If you want to replace them, I would do it with an MCU which support RMTP/Flash. Take a look at McuWeb project. Otherwise you need to write SIP Client code as well to integrate it with the SIP world