I am working with ESP8266 and Firebase-Arduino library. I am trying to use the stream function but I am facing a problem with Firebase.available().
I know that Firebase.available() returns a true value whenever a change occurs on the real time database. But in my case it returns a true value every 30 seconds irrespective of the change has taken place or not.
Is this normal?
If not then how to fix it?
I am using the example code provided for FirebaseStream.
When debugging my app with the simulator, the routine didUpdateLocations is never involved. What I do:
In the simulator, I select Debug>location>Custom Location and the window with longitude and latitude pops up. When pressing ok, I would expect the didUpdateLocations to be called.
I use locMgr as a global variable in a ViewController-module:
locMgr = CLLocationManager()
and in the viewDidLoad-function includes the following sequence:
locMgr.delegate = self
if CLLocationManager.authorizationStatus() == .NotDetermined {
locMgr.requestWhenInUseAuthorization()
}
I have coded the didUpdateLocations-function as a method of my viewcontroller class. I also verified (debugger), that the requestWhenInUseAuthorization-routine is invoked during initialisation. So were is the problem, why is the didUpdateLocations protocol-routine not invoked?
dasdom solved the problem by suggesting: Why requestWhenInUseAuthorization doesn't prompt the user for access to the location?
I am using TinyOS 2.1.0 under Xubuntos in my project. I want to get the
RSSI values in my simulation using TOSSIM as simulator. I used the command
call CC2420Packet.getRssi(msg)
The component is successfully buit. But when I built it for the simulation
(make micaz sim), i get an error saying that the component CC2420PacketC not
found.e
i used also :
event message_t* Receive.receive(message_t* pck,unit_8 len){
unit_8 Rssi_value=pck->metadata[1];
dbg(DBG_USR2, "Receive signal strength as %d\n"
(int)Rssi_value);
but i get allways 0 value for Rssi
From what I learned from the forums(https://www.millennium.berkeley.edu/pipermail/tinyos-help/2007-July/026348.html) TOSSIM always sends at 0dbm and doesn't give dynamic change in the signal strength. Remember simulators have the limitations and Tossim assumes everything runs smoothly. But if you are interested in estimating quality you should consider some other parameter such as gain which can be programmed using the TOSSIM.
Yesterday I got the update for Android 5.0 on my Nexus 4, and the altbeacon library stopped detecting beacons. It appears that didEnterRegion and didRangeBeaconsInRegion are not even getting called when monitoring and ranging, respectively.
Even the Locate app from Radius Networks behaves differently now, the values from beacons, once they are detected, doesn't get updated anymore and often it appears as if the beacons went out of range.
One thing I noted differently, is that now in the logcat it appears the following line "BluetoothLeScanner﹕ could not find callback wrapper". I went ahead and looked for that class and saw that it was introduced with Android L, but I don't know if that has something to do with it.
It's important to say that before the update I had been working with both the Locate app and the Reference Application without any trouble.
I don't know if this is a generalized problem or not, but if it happened to me I'm sure it could happen to someone else, so any help it would really be appreciated.
Thanks in advance!
UPDATE:
After failing at getting the library to work I decided to try the Android L branch of the library. What I did was that I plugged in the new library into the Reference App, but didn't work as expected either.
The Monitor Activity seems to be working ok by notifying when the device has entered a new region. However, the Ranging Activity doesn't report any beacons, although didRangeBeaconsInRegion is getting called, always report zero beacons. Curiously, when the activity is paused (switching momentarily to another app) the logcat shows that now didRangeBeaconsInRegion does get called with actual beacons.
I'm kind of stuck right now because I don't know how to get any of libraries working on Android L, so again, any help would really be appreciated.
I'm using the latest Altbeacon build on 5.0+ and have no problem with it. in fact, I never used it on kitkat so i'm not really sure i can help but here is my working code which listen to iBeacons.
implement beaconConsumer:
public class MainActivity implements BeaconConsumer
init BeaconManager
beaconManager = BeaconManager.getInstanceForApplication(this);
if (beaconManager != null && !beaconManager.isBound(this)) {
beaconManager.getBeaconParsers().add(new BeaconParser().
setBeaconLayout("m:0-3=4c000215,i:4-19,i:20-21,i:22-23,p:24-24"));
beaconManager.bind(this);
}
onConnect and start listner
#Override
public void onBeaconServiceConnect() {
beaconManager.setRangeNotifier(new RangeNotifier() {
#Override
public void didRangeBeaconsInRegion(Collection<Beacon> beacons, Region region) {
if (beacons.size() > 0) {
Beacon firstBeacon = beacons.iterator().next();
}
}
});
beaconManager.startRangingBeaconsInRegion(new Region("com.example.app", null, null, null));
}
this code is working on 3 devices
Nexus 4 5.0.1
Samsung Galaxy s4 - Stock 5.0.1
Samsung Galaxy s4 - CM12 5.1.1
Old question, but maybe some people will try to find answer for higher systems where you have to ask for permissions. You need to ask for Manifest.permission.ACCESS_FINE_LOCATION before scanning. At least that was the problem I met. In my opinion lib should crash such cases at least and indicate the problem
The adobe documentation says that when listening for a keypress event from a phone you should listen for Key.Down, however when I trace the Key.getCode() of keypresses I see a number not the string "Key.Down". I am tesing this locally in device central and do not have a phone to test this with at present. Here is my code -
keyListener = new Object();
keyListener.onKeyDown = function() {
switch (Key.getCode()) {
trace(Key.getCode()) // outputs 40
case (Key.DOWN) : // according to the docs
pressDown();
break;
}
}
My question is - is this simply because Im testing in device central and when I run it on the phone I will need to be listening for Key.Down? or is the documentation wrong? Also is the numeric code (40) consistent across all devices? What gives adobe?
thanks all
Key.Down is equal to 40 so it will recognize it as the same. So you can use whichever one you prefer, however, I would recommend using Key.Down because it will be easily recognizeable for those who dont have Key Codes memorized (most of us).
These are the Key Code Values for Javascript. However, I think they are pretty much universal