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

Pages: 1
1
TinyDuino Processors & TinyShields / Re: TinyDuino Connectors and pin-out
« on: November 15, 2014, 04:00:26 PM »
Does anyone know the name of the connector used to stack boards together? I'm trying to make a custom board for my TinyDuino.

Also, does anyone know the pin-outs the connectors? I'm new to eagleCAD, not at the point to be able to trace board drawings ... Thanks!!

Joseph

You can get this information from the schematics of any board..If you go the main tiny-circuits website and clip on for example the processor board and then click on design files and then click on schematic..you can get the info that you need.

2
TinyDuino Processors & TinyShields / Re: tiny duino wifi module issue
« on: November 13, 2014, 11:24:03 PM »
Hi,

I have a arduino yun and running a python scripted tcp socket server and waiting for new client connections and it work perfect with xbee wifi module. I want to try out with the tinydruino board with the WIFI stack, and the problem comes:

the tinydruino can connect to my server with no problem. However, after around half to 1 mins, the client continuously sends some unknown character to my server (On my server side it tells me that it received something from this tinydruino and the message has length 0 which confuses me) and then disconnected from the server. I don't know what exactly happened here since I am new to tinydruino.

below is the code on the tinydruino part:

Code: [Select]
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>
#include <string.h>
#include "utility/debug.h"

#include<stdlib.h>

// Define CC3000 chip pins
#define ADAFRUIT_CC3000_IRQ   2
#define ADAFRUIT_CC3000_VBAT  A3
#define ADAFRUIT_CC3000_CS    8

// WiFi network (change with your settings !)
#define WLAN_SSID       "pp"
#define WLAN_PASS       "123456"
#define WLAN_SECURITY   WLAN_SEC_WPA2 // This can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2

Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER);
uint32_t ip = cc3000.IP2U32(192,168,240,1);
int port = 55555;
int BUFSIZ = 128;

const unsigned long
dhcpTimeout     = 60L * 1000L, // Max time to wait for address from DHCP
connectTimeout  = 15L * 1000L, // Max time to wait for server connection
responseTimeout = 15L * 1000L; // Max time to wait for data from server

uint32_t   t;
char c;
// PHP's server IP, port, and repository (change with your settings !)

Adafruit_CC3000_Client client;

void setup(void)
{
  Serial.begin(9600);

  Serial.print(F("Initializing..."));
  if(!cc3000.begin()) {
    Serial.println(F("failed. Check your wiring?"));
    return;
  }
 
  Serial.println(F("\nDeleting old connection profiles"));
  if (!cc3000.deleteProfiles()) {
    Serial.println(F("Failed!"));
    while(1);
  }

  Serial.print(F("OK.\r\nConnecting to network..."));
  cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
  Serial.println(F("connected!"));

  Serial.print(F("Requesting address from DHCP server..."));
  for(t=millis(); !cc3000.checkDHCP() && ((millis() - t) < dhcpTimeout); delay(250)) {
    //Serial.println("....waiting");
  }
  if(cc3000.checkDHCP()) {
    Serial.println(F("OK"));
  }
  else {
    Serial.println(F("failed"));
    return;
  }

  //Open Socket
  Serial.println("...Connecting to server");
  t = millis();
  do {
    client = cc3000.connectTCP(ip, port);
    delay(100);
  }
  while((!client.connected()) && ((millis() - t) < connectTimeout));
 
  // Send request
  if (client.connected()) {
    Serial.println("Connected");
    Serial.println("...Sending request...");
    client.fastrprint("hello server");
  }
  else {
    Serial.println(F("Connection failed"));   
    return;
  }
   
}

void loop(void)
{
  if (client.available()){
    c = client.read();
    Serial.print(c);
  }
  delay(5);
}

Thanks in advance...


I think there must be some memory leak in the code because we had a similar problem with just a chat server.
You establish the connection..then start sending data back and forth and then it would stop after 3 minutes. There is FreeMEM() function that can tell you how much memory you have.  If you get close to the end of memory and sketch code, the chance that it will stop increase.  The real problem with the Wifi code is it is just too much code for this type of processor and it is using too much of memory. We went to using a library called PString to cut down on Serial.print code and it decrease the code size a lot.

The one thing that helped was to read as many bytes as possible..so you could replace the:

client.read();

with

 int =client.readBytes(buffer,sizeof(buffer);

this will read the data and wait up to 1000ms (1sec)
until there is data available..if you want to change this

You can change it but I dont remember what it was, I think client.SetTimeout(n);
But base on what have it should work...

3
TinyDuino Processors & TinyShields / Re: Help with GPS code please
« on: November 13, 2014, 11:04:22 PM »
I followed the tutorial at http://www.instructables.com/id/Tinyduino-LEGO-GPS-battery-powered-Logger-DIY/?ALLSTEPS for a GPS logger with LEDs.

Unfortunately I've not had any success with the GPS getting a signal and logging to the SD.

The code is attached. Please could someone take a look and see why it isn't working.

Many thanks.

I think the problem is with your smart delay you have this and it should be this:

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do
  {
    while (ss.available())
      gps.encode(ss.read());
  } while (millis() - start < ms);
}

try:

static void smartDelay(unsigned long ms)
{
  unsigned long start = millis();
  do
  { // read all the data from the GPS -- otherwise it breaks the TinyGPS
     // this occurs every second from the GPS chip
    while (ss.available()>0)
       gps.encode(ss.read());

  } while (millis() - start < ms);
}


The other thing is some of the GPS chips require that you are outside inorder to get any signal.
They just return 0's if you are inside.  It should sync up in a few minutes outside..if not then something
else is wrong..

4
Hi,
I have been trying to use the accelerometer and GPS together.  I am following the examples for GPS and Accelerometer. I am using Software Serial and Wire. However I find amalgamating the two examples the code continually restarts like there is a conflict between the two libraries. Though I have trimmed out a lot of GPS code to make the sketch smaller.
I notice there was previous topic with a conflict GPS and wifi,. Could there be a similar issue here?

If you want want them to work together, you have to read all the data from the GPS and then read you can read the data from the Accelerator chip...

So for example:

void loop()
{
       //give me time in ms
       uint16_t slice = millis() % 1000;

      // read the acc data every 100ms
      if (slice % 100) <= 1)
        read_acc_data();

      // this will occur every second with data
      while (gps_serial.available() > 0)
      {  byte data= gps_serial.read();
          ....
      }

}

There is this library code called TinyGPS++ that work with this and has some good examples on
how to use the GPS...there is also a CAT logger program that works with the GPS as well.
That is a good place to start with the GPS.

The GPS does work with the accelerator chip but it does not work with classic blue toothe..
the blue toothe signal drowns out the GPS signal. The GPS signal does have to be outside
though for it to work.



Pages: 1
SMF spam blocked by CleanTalk