Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tolson

Pages: [1] 2 3 ... 57
1
Support / Re: Simblee getting input voltage
« on: August 18, 2017, 09:37:24 AM »
Has anyone fix the wide range of differences?

Hi Wayne,

Are you getting these variations. Of so, then not. If not, then so. I guess.

On a project I am using the above on, I am getting 4mV differences. All depends on battery load at moment of test.

2
Simblee For Mobile / Re: SimbleeForMobile two screens
« on: August 14, 2017, 07:07:02 PM »
Hi Stanley,

I edited your post for you so it is better readable.

You can/should wrap your sketch between CODE flags.

As far as your code generating the image on both screens... Looks like that is what your code is saying to do. You define, initialize, and drawImage in both createScreen1 and createScreen2.

3
Knowing that it is just turning GPIO 31 on and off you can just use the Arduino way of doing that.

pinMode(31, OUTPUT);

digitalWrite(31, HIGH);
or
digitalWrite(31, LOW);

4
I for one would like to hear more about details to do these things.

5

  Pertaining to this one to many topology shown with a phone, is this phone-to-many Simblees or a master Simblee to many Simblees?

Hi danlsk,

The Simblee does not support BLE central. So the trick seems to be phone-to-Simblee using SimbleeForMobile ( am not sure about SimbleeBLE ). Then that particular Simblee is one-to-many with all the other Simblee's, but only via SimbleeCOM, which is a proprietary protocol. It is not completely understood by many as far as I can tell.

6
Hi adme,

All good questions. Hopeully someone in the know from RFDigital will give full details.

One thing that might be affecting your distance. Within the Simblee Chip itself they tied GPIO31 to a switch, which essentially attenuates the antenna so it is only good for up close. I assumed the closeness was on the order of a few inches like perhaps for doing something like NFC. But who knows. Perhaps 20 feet is it.

It is described in the SimbleeCOM documentation. Sometimes the INCLUDES and CPP files in the libraries provide interesting explanations.

From the SimbleeCOM pdf file...
SimbleeCOM.proximityMode
Proximity mode brings the range of the Simblee module to a very close proximity. This is for use in security
applications, or when connection to a Simblee device requires the user to be very close.

SimbleeCOM.proximityMode(FALSE); //proximity mode is set to FALSE on default

And from the INCLUDES/CPP files that API does this..
Code: [Select]
void SimbleeCOMClass::proximityMode(bool enable)
{
  if (enable)
    NRF_GPIO->OUTSET = (1 << 31);
  else
    NRF_GPIO->OUTCLR = (1 << 31);
}

The SimbleeBLE INCLUDE has a similar function...
Code: [Select]
void SimbleeBLEClass::proximityMode(bool enable)
{
  if (enable)
    NRF_GPIO->OUTSET = (1 << 31);
  else
    NRF_GPIO->OUTCLR = (1 << 31);
}


So I assume the API would be like..
SimbleeBLE.proximityMode(FALSE);

Give it a try!

Another thing to look at using is the txPowerLevel API. Odds are there are conflicts with that and the antenna attenuator. Need detailed engineering explanation of how this stuff is connected and used to know for sure.

SimbleeBLE.txPowerLevel = +4; // Sets transmit power to max +4dBm.
Possible values are -20, -16, -12, -8, -4, 0, +4
The default is suppose to be +4.

At any rate, your best path to trying to understand things is to take a look at the comments within the various INCLUDE files.

And then there is...
Not knowing how you laid out your PCB, you can't have any metal or traces crossing under the antenna area of the chip. This could be your problem. If you look at the old RFduino chip documentation, they published excellent RF layout considerations. The same rules apply for the much smaller Simblee module(chip).

7
Bugs / Re: required SimbleeForMobile configuration
« on: July 25, 2017, 09:24:02 PM »
This happens when the cache is out of date.  Close the simblee app on the phone and restart
Not that simple. Been there, done that, didn't help. Often took several repeats including power off and on, etc.
And then worked until the next time. May or may not have been fixed since then.

8
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 19, 2017, 10:40:12 AM »
Since you really just wanted to change the width of the bargraph use...

SimbleeForMobile.updateW(ss, width);
I know this works.

Also, just thought, you are updating in the loop and would seem to be at a too high rate for
the SimbleeForMobile.process();

So need to scheme how to update the bargraph at a slower rate.
Could put delay(200) after the updateW, but being in the loop that slows down response to/from phone.

So best to use a update routine using millis and millisLast examples.

Don't know why SimbleForMobile.updateRect is not working so well. Perhaps way too many things to update in the loop too often.
Don't really need it since you can update just what needs to be updated. Other than that, I suggest calling RFdigital to get their attention on the matter.


9
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 18, 2017, 07:58:51 PM »
I don't know. This works for me. If it works for you, perhaps you can do a diff.

Code: [Select]
#include <SimbleeForMobile.h>

uint8_t toScreen2ButtonID;

uint8_t toScreen1ButtonID;

uint8_t currentScreen;


uint8_t ss;                                                    //AK

/*
 * Traditional Arduino setup routine
 *
 * Initialize the SimbleeForMobile environment.
 */
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  Serial.println("Setup beginning");
 
  SimbleeForMobile.deviceName = "2Screens";                  //AK
  SimbleeForMobile.advertisementData = "Sample";

  //SimbleeForMobile.domain = "twoscreensak.simblee.com";         //AK // You should use your own domain
 
  SimbleeForMobile.begin();
 
  Serial.println("Setup completed");
}

void loop() {
  // put your main code here, to run repeatedly:
  // process must be called in the loop for Simblee UI
  if (SimbleeForMobile.updatable && currentScreen == 1){                                   //AK
    //SimbleeForMobile.updateRect(ss, 80, 300, 150, 50);              //AK
  };                                                                 //AK
  SimbleeForMobile.process();
}

void SimbleeForMobile_onConnect()
{
  currentScreen = -1;
}

void SimbleeForMobile_onDisconnect()
{
}

void ui()
{
  if(SimbleeForMobile.screen == currentScreen) return;
 
  currentScreen = SimbleeForMobile.screen;
  switch(currentScreen)
  {
    case 1:
      createScreen1();
      break;
       
    case 2:
      createScreen2();
      break;
           
   default:
      Serial.print("ui: Unknown screen requested: ");
      Serial.println(SimbleeForMobile.screen);
  }
}

void ui_event(event_t &event)
{
//  printEvent(event);
  if(event.id == toScreen1ButtonID && event.type == EVENT_RELEASE && currentScreen == 2)
  {
    SimbleeForMobile.showScreen(1);
  } else if(event.id == toScreen2ButtonID && event.type == EVENT_RELEASE && currentScreen == 1)
  {
    SimbleeForMobile.showScreen(2);
  }
}

void createScreen1()
{
  //
  // Portrait mode is the default, so that isn't required
  // here, but shown for completeness. LANDSCAPE could be
  // used for that orientation.
  //
  SimbleeForMobile.beginScreen(YELLOW, PORTRAIT);

  int textID = SimbleeForMobile.drawText(80, 60, "Screen 1", BLACK, 40);
  toScreen2ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 2");

  ss = SimbleeForMobile.drawRect(80, 300, 100, 50, RED);                          //AK

  SimbleeForMobile.setEvents(toScreen2ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

void createScreen2()
{
  //
  // Default to Portrait orientation
  //
  SimbleeForMobile.beginScreen(WHITE);

  int textID = SimbleeForMobile.drawText(80, 60, "Screen 2", BLACK, 40);
  toScreen1ButtonID = SimbleeForMobile.drawButton(100, 200, 100, "Screen 1");

  SimbleeForMobile.setEvents(toScreen1ButtonID, EVENT_RELEASE);
  SimbleeForMobile.endScreen();
}

void printEvent(event_t &event)
{
  Serial.println("Event:");
  Serial.print("  ID: ");
  Serial.println(event.id);
 
  Serial.print("   Type: ");
  Serial.println(event.type);

  Serial.print("   Value: ");
  Serial.println(event.value);
 
  Serial.print("   Text: ");
  Serial.println(event.text);
 
  Serial.print("   Coords: ");
  Serial.print(event.x);
  Serial.print(",");
  Serial.println(event.y);
}

10
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 18, 2017, 02:19:58 PM »
Some minor things first...
1). The spec defines IDs as 'uint8_t'. Don't know why many examples are still using 'int' and have not been corrected, yet.
2). SimbleeForMobile.domain should use your own domain or other than Simblee.com's.

But your problem is you are trying to update/draw your bargraph when you are not in the screen it is in. Thus the crash.
So be sure to test that you are in the screen of the rectangle you are wanting to change.
  if (SimbleeForMobile.updatable && currentScreen == 1){
Also, be sure your coordinates don't overwrite other objects or go off screen. I moved yours bargraph down below the button.

Code: [Select]
void loop() {

  if (SimbleeForMobile.updatable && currentScreen == 1){
    SimbleeForMobile.updateRect(ss, 80, 300, 150, 50);
  }
  SimbleeForMobile.process();
}

11
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 17, 2017, 07:57:02 PM »
I would appreciate code that I can just grab and put into the IDE. As is I have to generate a bunch that I don't know if you'd do it that way.

13
Just downloaded the OneWire library from the Github link you provided to compare just in case I had mods in my copy of the library. Looks like they are exactly identical. So here is output using the Github fresh install.

Only modification was to change
OneWire ds(10);
to
OneWire ds(2);

Here is the output to the Serial Monitor. Notice the temperature going up as I apply my finger to the ds18b20.

Code: [Select]

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 1F 48 70  CRC=70
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 20 48 45  CRC=45
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 4 48 BF  CRC=BF
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 35 0 0 0 FF FF 6 48 BD  CRC=BD
  Temperature = 26.50 Celsius, 79.70 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 37 0 0 0 FF FF 1F 49 3B  CRC=3B
  Temperature = 27.50 Celsius, 81.50 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 45 49 51  CRC=51
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 28 49 82  CRC=82
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.


ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 1F 48 70  CRC=70
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 20 48 45  CRC=45
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 33 0 0 0 FF FF 4 48 BF  CRC=BF
  Temperature = 25.50 Celsius, 77.90 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 35 0 0 0 FF FF 6 48 BD  CRC=BD
  Temperature = 26.50 Celsius, 79.70 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 37 0 0 0 FF FF 1F 49 3B  CRC=3B
  Temperature = 27.50 Celsius, 81.50 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 45 49 51  CRC=51
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.

ROM = 10 C1 D1 6 0 0 0 C9
  Chip = DS18S20
  Data = 1 38 0 0 0 FF FF 28 49 82  CRC=82
  Temperature = 28.00 Celsius, 82.40 Fahrenheit
No more addresses.



14
Don't know of any special one-wire library. But this script I used to test the 18B20 uses the 2.3.3 onewire library and it is still working with Arduino 1.8.1 and RFduino library 2.3.3.

I am using RFduino Pin2. The VCC for the 18B20 is the RFduino 3V pin. There is a 4.7K ohm from pin2 to the RFduino 3V pin. Do not use 5V  with RFduino.

Code: [Select]
#include <OneWire.h>
#include <RFduinoBLE.h>

// OneWire DS18S20, DS18B20, DS1822 Temperature Example
//
// http://www.pjrc.com/teensy/td_libs_OneWire.html
//
// The DallasTemperature library can do all this work for you!
// http://milesburton.com/Dallas_Temperature_Control_Library
// Thomas Olson Modified to send data via RFduino BLE.

OneWire  ds(2);  // on pin 10 (a 4.7K resistor is necessary)

void setup(void) {
 // Serial.begin(9600);
    RFduinoBLE.advertisementData = "temp";
    RFduinoBLE.deviceName = "DS18B20";
  // start the BLE stack
  RFduinoBLE.begin();
}

void loop(void) {
  byte i;
  byte present = 0;
  byte type_s;
  byte data[12];
  byte addr[8];
  float celsius, fahrenheit;
 
  if ( !ds.search(addr)) {
  //  Serial.println("No more addresses.");
   // Serial.println();
    ds.reset_search();
    delay(250);
    return;
  }
 
  Serial.print("ROM =");
  for( i = 0; i < 8; i++) {
    Serial.write(' ');
    Serial.print(addr[i], HEX);
  }

  if (OneWire::crc8(addr, 7) != addr[7]) {
      Serial.println("CRC is not valid!");
      return;
  }
  Serial.println();
 
  // the first ROM byte indicates which chip
  switch (addr[0]) {
    case 0x10:
      Serial.println("  Chip = DS18S20");  // or old DS1820
      type_s = 1;
      break;
    case 0x28:
      Serial.println("  Chip = DS18B20");
      type_s = 0;
      break;
    case 0x22:
      Serial.println("  Chip = DS1822");
      type_s = 0;
      break;
    default:
      Serial.println("Device is not a DS18x20 family device.");
      return;
  }

  ds.reset();
  ds.select(addr);
  ds.write(0x44, 1);        // start conversion, with parasite power on at the end
 
  delay(1000);     // maybe 750ms is enough, maybe not
  // we might do a ds.depower() here, but the reset will take care of it.
 
  present = ds.reset();
  ds.select(addr);   
  ds.write(0xBE);         // Read Scratchpad

 // Serial.print("  Data = ");
 // Serial.print(present, HEX);
 // Serial.print(" ");
  for ( i = 0; i < 9; i++) {           // we need 9 bytes
    data[i] = ds.read();
  //  Serial.print(data[i], HEX);
   // Serial.print(" ");
  }
//  Serial.print(" CRC=");
 // Serial.print(OneWire::crc8(data, 8), HEX);
 // Serial.println();

  // Convert the data to actual temperature
  // because the result is a 16 bit signed integer, it should
  // be stored to an "int16_t" type, which is always 16 bits
  // even when compiled on a 32 bit processor.
  int16_t raw = (data[1] << 8) | data[0];
  if (type_s) {
    raw = raw << 3; // 9 bit resolution default
    if (data[7] == 0x10) {
      // "count remain" gives full 12 bit resolution
      raw = (raw & 0xFFF0) + 12 - data[6];
    }
  } else {
    byte cfg = (data[4] & 0x60);
    // at lower res, the low bits are undefined, so let's zero them
    if (cfg == 0x00) raw = raw & ~7;  // 9 bit resolution, 93.75 ms
    else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
    else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
    //// default is 12 bit resolution, 750 ms conversion time
  }
  celsius = (float)raw / 16.0;
  fahrenheit = celsius * 1.8 + 32.0;
  /*Serial.print("  Temperature = ");
  Serial.print(celsius);
  Serial.print(" Celsius, ");
  Serial.print(fahrenheit);
  Serial.println(" Fahrenheit");
  */
    RFduinoBLE.sendFloat(celsius);
}

15
Simblee For Mobile / Re: updateRect() causes Android App to Crash
« on: July 17, 2017, 03:28:02 PM »
Need more info. Can't tell what you are doing with just those calls. So have to guess. For example if your ssWidth is mean to be the width of you bar indicator(assuming you are using the rectangle as a bar graph. Then perhaps you have it in the wrong location. The fifth field is the height of the rectangle. The forth field is the width of the rectangle. So, I don't, perhaps you are exceeding the range. Just guessing. How about posting a complet sketch that should work if the two lines worked. In other words, don't need the whole project... Just a test script to get just this part your project tested out.

Pages: [1] 2 3 ... 57