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 - MitchLampert

Pages: 1
Just an update. It appears as though I might have gotten a BAD WiFi shield unit.  :( I happened to run the code on a different set of parts, and THEN it always worked perfectly!

I replace only the WiFi shield within those parts, with the one I previously tried, and it gets issues again.

So, it looks like this wasn't a code problem. I'll see about getting a refund or replacement, soon, on this bad unit.

I would like to connect a local address like this:
Note that: I am calling the IP address directly, using a nonstandard port (8080), and there are parameters after the web page name.

I believe I should be able to do this with the following code. However it doesn't seem to be reliable:

Code: [Select]
  ip = 3232235780; // converted to int.
  Adafruit_CC3000_Client www = cc3000.connectTCP(ip, 8080);
  if (www.connected()) {
    www.fastrprint(F("GET "));
    www.fastrprint(F(" HTTP/1.1\r\n"));
    www.fastrprint(F("Host: ")); www.fastrprint(""); www.fastrprint(F("\r\n"));
  } else {
    Serial.println(F("Connection failed"));   

  /* Read data until either the connection is closed, or the idle timeout is reached. */
  unsigned long lastRead = millis();
  while (www.connected() && (millis() - lastRead < IDLE_TIMEOUT_MS)) {
    while (www.available()) {
      char c =;
      lastRead = millis();

Whenever I call the address at the top of the post in a browser, it always works reliably. But, the code above seems to load the wrong content most of the time. And, weirdly, might start working properly after a while.

Any ideas on what's going on, and what to do about that?

Thanks for the update, Ben.

(I figured the Time library probably didn't have anything to do with it.)

Well, pulling the Time library from CodeBender into the Arduino environment didn't help.

But, I decided to compile and run the example from the browser-based CodeBender app, and THAT worked!

So, at least I got the demo working in one manner. However, I would prefer to program for the Bluetooth shield from within the Arduino environment. I suppose I'll just have to find code that works in there.

Thanks for the nudge in this direction, everyone!

Paul's library, that I am using, begins this way:

  time.c - low level time and date functions
  Copyright (c) Michael Margolis 2009-2014

So, it's similar. But, I will try different ones, from CodeBender and perhaps a couple of others, soon.

This isn't my code, and I wasn't intending to change any of it. I just wanted to get this demo working, before getting on with anything else.

I figured, I could crawl down the rabbit hole of figuring out the fundamental problem with the demo, fixing every line as I went along, if I had to. But, I couldn't believe that I was the first person to have this issue. Surely, others have run into this, and someone knew of a standard fix, of some sort? Searching forums and Google didn't help. So, I started this thread before going further.

For reference, this is the line, in UART.h, the second error points to:
aci_state.aci_setup_info.setup_msgs         = setup_msgs;

I was also thinking, perhaps, that this is an outdated demo? Perhaps there's a newer Bluetooth/Smart Watch demo around, that I missed, some how? If there is, I could go with that, instead of this one:


I am trying to compile the Smart Watch example code for Android, from this project:

I also added these to the libraries:
Tiny Screen:
Time, which I found referenced in another thread:

But, I get this compile error:
variable 'setup_msgs' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

Points to this line in UART.h:
static hal_aci_data_t setup_msgs[NB_SETUP_MESSAGES] PROGMEM = SETUP_MESSAGES_CONTENT;

If I make that line const, I get this error, instead:
invalid conversion from 'const hal_aci_data_t*' to 'hal_aci_data_t*' [-fpermissive]

Anyone know what is going on?

I am using Arduino 1.6.7

Pages: 1
SMF spam blocked by CleanTalk