ESP8266 Xap and Alexa
I have been messing around with the ESP8266 and have built an xAP library framework for it.
One of the demo's posted is for simultaneous Alexa and xAP control check out xapDemo4.ino
https://github.com/dbzoo/esp8266-xap
xapDemo4 - Alexa/Xap demo video https://photos.app.goo.gl/0cGw7Hnf8Qec6Qm83
I'm using a sonoff dev board with a few electronic bricks for quick prototyping:
https://www.itead.cc/sonoff-dev.html
Brett
.... didn't read the other recent posts. Am I to assume that Graphite using some sort of Cloud resource is the preferred answer now?
After normal faffing around with dependent libraries I got all four demos working. Yay!
Points: 1) In the button demo 2, the lamps did not do anything on xfx viewer - even though I got button pressed messages. Admittedly I didn't actually wire the leds up.
2) In Demo4 I got the following error:
----------------------------------------------------------------------
xapDemo4:64: error: void value not ignored as it ought to be
const unsigned char lampMo1 = fauxmo.addDevice("lamp one"); // device_id 0
----------------------------------------------------------------------
which without much hope I changed to:
---------------------------------------------------------------
fauxmo.addDevice("lamp one");
const unsigned char lampMo1 = 0;
---------------------------------------------------------------
this is using Arduino 1.8.3 and may be entirely wrong - except it seems to work :)
Now back to reading all the stuff in HAH about xap/MQTT - so far I can only find MQTT --> xap (for iserver?) and not the other way around.
Happy New Year!
.... how right you are. Mine says:
class fauxmoESP {
public:
fauxmoESP(unsigned int port = DEFAULT_TCP_BASE_PORT);
void addDevice(const char * device_name);
void onMessage(TStateFunction fn) { _callback = fn; }
void enable(bool enable) { _enabled = enable; }
void handle();
It was in there - but not updateable. Probably because I dumped the unzipped into the libraries folder rather than using the manager.
Got v 2.3.0 in there now. Thanks for your help.
Kim
This is a really nice library. In no time at all I've managed to knock up an ESP8266 node running an input from my smoke alarm, 1wire temp and acting as a URF transmitter. Excellent stuff, many thanks for your efforts!
one thing I did notice, the classes are reporting as info and event and not xAPBSC.info, etc
traced this down to the following line in Bsc.cpp
BscInfoEvent::Info ? "info" : "event";
Changed it in my version of library and all good now
thanks again
Garry
Hello
for a while I come back to this project but the lib have evolved, I have a compilation error while trying to create new devices for my installation. an idea ?
Les options de compilation ont été modifiées, tout sera recompilé
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp: In lambda function:
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp:21:20: error: ambiguous overload for 'operator~' (operand type is 'IPAddress')
_broadcastIP = ~WiFi.subnetMask() | WiFi.gatewayIP();
^
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp:21:20: note: candidates are:
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp:21:20: note: operator~(uint32_t {aka unsigned int}) <built-in>
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp:21:20: note: operator~(u32_t {aka long unsigned int}) <built-in>
C:\Users\vincent\Documents\Arduino\libraries\xap\xap.cpp:21:20: note: operator~(int) <built-in>
exit status 1
Erreur de compilation pour la carte WeMos D1 R1
hello, i had corrected in my arduino ide, i am at work with sonoff products, long life to xap
.... because 1) I have been given an Alexa for Xmas 2) Xively have announced they are closing down their personal sites in mid Jan 2018. I emailed them about commercial rates and they said "tens of thousands"!
I need to look elsewhere - and work out how to do it. Any recommendations?
Up until now I have been using Wemos D1 minis quite a lot (up to 6 so far in various places) and AdaFruit io - however they only allow 10 feeds and I have 16 from two of your liveboxes alone!
The idea of having a wemos sitting on the network picking up the xap packets and publishing them somewhere is attractive - especially if I can then find a way of interrogating the data with an Alexa skill. Lots of steps there I know.
So I shall start off trying one of your demos and seeing if I can get it to be an xfx message viewer.
Attached is one of my "programs" (uploaded as a txt file 'cos it won't accept .ino) - I can't really program in C but seem to be able to hack other peoples a bit. This has quite a nice WIFI manager which avoids hard coding wifi credentials. Great when I have to move the device to someone else's network (the village hall archive in this case). Also I had to make use of deepsleep - stopping everything for five minutes - otherwise the temperature picked up the heat of the esp8266 and overread and the humidity under-read. Letting it all cool down in deep sleep seemed to sort it.
Don't laugh at my programming please!
Happy new year
Kim