Show Posts
Pages: [1] 2 3 ... 14
1  Using Arduino / Microcontrollers / Re: attiny 85, any pointers?/ on: August 27, 2014, 03:57:56 pm
Thanks again Stanley

The problem is the ATTINY84 does not seem to want to play the game :-(
I can't seem to find the pin mapping for SPI and the ATTINY84 there and even though the repo says the core obeys the original attiny84 core pin mappings I have had no success using the ATTINY84.


Hv u read my blog entry on this matter... Did u try them out yet ?

http://arduino-for-beginners.blogspot.com/2013/08/getting-nrf24l01-to-work-with-attiny84.html
2  Topics / Home Automation and Networked Objects / Re: ATMega328@8MHz + DHT11 + nRF24L01+ =Problem on: August 21, 2014, 01:27:48 am
Hv u ever consider attiny84 ..

http://arduino-for-beginners.blogspot.com/2014/05/tinysafeboot-on-attiny84.html


I made the PCBs for attiny84 and nRf24L01 with some spare proto area...
3  Using Arduino / Programming Questions / Re: Wireless (nrf24l01) altimeter for RC plane (completed project with code) on: August 21, 2014, 01:24:39 am
I've done this before.. pls hv a look at my blog entry below...

I've to split up the GPS NMEA sentences into 3 fragments as RF24 only have a max payload of 32 Bytes

Hv to do with the software serial not fast enough ... you may try AltSoftSerial https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html from PJRC or swap the h/w and s/w serial....

http://arduino-for-beginners.blogspot.com/2013/06/arduino-serial-over-nrf24l01.html

4  Using Arduino / Networking, Protocols, and Devices / Re: NRF24l01+ not working consistently on: August 21, 2014, 01:14:32 am
Try these..

http://arduino-for-beginners.blogspot.com/2014/08/arduino-uno-nrf-adapter.html
5  Using Arduino / Microcontrollers / Re: attiny 85, any pointers?/ on: August 20, 2014, 12:56:15 pm
Use this libs :-

https://github.com/TMRh20

He hv both RF24 (for attinyXX) and RF24Network ..

You do NOT need to modify the orig SPI.h at all..

6  Using Arduino / Microcontrollers / Re: attiny 85, any pointers?/ on: August 18, 2014, 02:24:57 pm
Hi Joe,

1. As long as you are using the same tiny cores, you are good..

2. Yes, swap them and try to upload something to the attiny85

3. Ignore this statement, it was from my Mirf codes... just use the RF24 libs that are now supported for most of the platforms including attiny 85 & 84 ( but you do not have much space left )

4. The below is to check for X5 ( where X = attiny 25, 45 & 85 ) mcu and do the necessary define if you write codes for multiple platforms or mcu...

Code:
#if defined( __AVR_ATtinyX5__ )
7  Using Arduino / Microcontrollers / Re: attiny 85, any pointers?/ on: August 17, 2014, 11:17:56 pm
I'm using the tiny cores from https://code.google.com/p/arduino-tiny/
See under hardware/tiny/avr/cores/tiny/pins_arduino.c
Code:
#if defined( __AVR_ATtinyX5__ )

// ATMEL ATTINY45 / ARDUINO
//
//                           +-\/-+
//  Ain0       (D  5)  PB5  1|    |8   VCC
//  Ain3       (D  3)  PB3  2|    |7   PB2  (D  2)  INT0  Ain1
//  Ain2       (D  4)  PB4  3|    |6   PB1  (D  1)        pwm1
//                     GND  4|    |5   PB0  (D  0)        pwm0
//                           +----+


Different "tiny cores" maps the digital pins differently...

This is my working attiny85 pinout :-
Code:
// Pinout ( physical pin / Digital pins / nRF side )
// CE   - Pin 2 / D3 / nRF3
// CSN  - Pin 3 / D4 / nRF4
// GND  - Pin 4
// MISO - Pin 5 / D0 / nRF7
// MOSI - Pin 6 / D1 / nRF6
// SCK  - Pin 7 / D2 / nRF5
// Vcc  - Pin 8 ( 3.3V )

#define CE  PB3 //ATTiny pin2
#define CSN PB4 //ATTiny pin3


8  Using Arduino / Networking, Protocols, and Devices / Re: RF24 Library: Driver for nRF24L01(+) 2.4GHz Wireless Transceiver on: August 14, 2014, 02:03:26 am
My journey into making a nRF24L01 adapter for UNO with lots of pictures...

http://arduino-for-beginners.blogspot.com/2014/08/arduino-uno-nrf-adapter.html



9  Using Arduino / Programming Questions / Splitting a String into two other Strings on: August 04, 2014, 11:53:52 am
Hi,

I've decoded packets like these coming in from the serial port with this format :-

Code:
SRC: [8M4ABC-0] DATA: !/Leo2h5"lr st 11.7V 21C 12345
SRC: [8M4GQQ-1] DATA: !0304.57NI10135.55E#9 243565
SRC: [8M4ABC-0] DATA: !/Leo2h5"lr st 11.7V 21C 636673673
SRC: [8W2BUT-2] DATA: =0313.44N/10137.19E&I-Gate 36347 35667 435745
SRC: [8w2VVV-9] DATA: !0309.56N/10135.31E# --fill in Digipeater 144.3900mhz 12.18V

I've the following codes below but it works at times and at other times, anything also goes into the callsign and data strings

At times, even without the [ or ] or DATA: , those garbage strings still got into the String of callsign and data ...

Can anyone help to review my codes below or give some better suggestions or idea to solve this issue...

I search for callsign in between [ and ] and for data, I took the entire string after the word DATA:

Thanks...


Correctly decoded :-
Code:
Decoded Packets:SRC: [8W2BUT-2] DATA: >041650zDX: 8M4RDG-3
Callsign:8W2BUT-2
Data:>041650zDX: 8M4RDG-3


Wrongly decoded :-
Code:
Decoded Packets:3.25.72N 101.47.35E 18.3 miles 40ø 00:37
Callsign:3.25.72N 101.47.35E 18.3 miles 40ø 00:37
Data:72N 101.47.35E 18.3 miles 40ø 00:37



Code:
     
String decoded="";
      int callIndex,callIndex2, dataIndex = 0;
 
....
// Assuming the packets are stored in String called decoded
      debug.print("Decoded Packets:");
      debug.println(decoded);

      callIndex = decoded.indexOf("[");
      callIndex2 = decoded.indexOf("]");
      String callsign = decoded.substring(callIndex+1,callIndex2);
     
      dataIndex = decoded.indexOf("DATA:");
      String data = decoded.substring(dataIndex+6,decoded.length());

         debug.print(F("Callsign:"));
         debug.println(callsign);
         debug.print(F("Data:"));
         debug.println(data);


10  General Category / General Discussion / Re: NavSpark: 32-bit Arduino-style device with built-in GPS for $19 on: July 30, 2014, 07:37:47 am
Thanks... I re-posted this on NavSpark forum...

11  General Category / General Discussion / Re: NavSpark: 32-bit Arduino-style device with built-in GPS for $19 on: July 30, 2014, 06:09:27 am
I'm interested to get this NavSpark for the following usage.. pls advise if this board is suitable ?

Used as an APRS Tracker ( http://en.wikipedia.org/wiki/Automatic_Packet_Reporting_System )

- Connect to an APRS modem ( also running a atmega328 with BeRTOS to encode/decode APRS packet )
- Connect to LCD/TFT for displaying  GPS loc / decoded APRS packets
- Do some algorithm based on the GPS speed/headings/distance travel

This will saved me from buying a GPS module and used up 2 more pins for running Software Serial...

The details of my projects are in the URL below
http://9w2svt.blogspot.com/2014/07/building-open-source-arduino-aprs.html


Is the external GPS antenna good as it looks rather fragile  ??

Thanks

Stanley
12  Community / Exhibition / Gallery / Building an Arduino APRS Tracker (ham radio) on: July 21, 2014, 01:08:52 pm
Here are my blog entries on building an APRS Tracker using Arduino ( on-going project )

http://9w2svt.blogspot.com/2014/07/building-open-source-arduino-aprs.html


I welcome anyone to test out my codes and contribute to the codes by forking my repo

Thanks

Stanley
13  Using Arduino / Displays / Re: Serial SPI - 2.2" TFT LCD - ILI9341 on: July 20, 2014, 02:09:41 am
I captured another video (UTFT fonts demo), as well as I published the source code files of modified examples and libraries.
Adafruit
MultiLCD
UTFT
schematic


Thanks, this info is great... I got my TFT working...!!!



14  Using Arduino / Networking, Protocols, and Devices / Problem with 3 Serial Ports on UNO on: July 14, 2014, 08:06:47 pm
Hi all,

I wrote a wrapper for this APRS Modem/BeRTOS firmware ( http://unsigned.io/microaprs/ ) ...
The Arduino wrapper are located at https://github.com/stanleyseow/ArduinoTracker-MicroAPRS

I wanted to write something similar to Radio Shield 2  https://www.argentdata.com/catalog/product_info.php?products_id=136 but completely open source ...

I needed 3 Serial port for the following functions :-

Pin 0,1 ( 9600) - connect to the APRS Modem to send commands and received decoded APRS packets from the radio
Pin 2,3 (9600) - connect to GPS module for GPS coordinates ( SoftwareSerial )
Pin 8,9 (57600) - connect to a FTDI Serial USB module for Debugging and send in commands purposes...

- pin 8,9 are using AltSoftSerial http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html

Things that are not working (yet) are :-

- I could not copied the entire decoded APRS packet into a String or char array

I want to display the CALLSIGN ( the string after the SRC: )  and DATA: on the 20x4 LCD but I could not grab the entire row or only partial of the sample string below..

I suspect there are too many calls to other serial port ( e.g. GPS on Software Serial or Debug ) and therefore blocking this..

How shall I solve this Serial port issue with 3 Serial ports running at the same time...

Thanks

Stanley



The output of decoded messages from the APRS modem are as below :-

Code:
SRC: [9W2BBB-12] PATH: [9M2KKK-3] [WIDE1-1] [WIDE2-2] DATA: !/Lq@Yh1usP?DG/A=000273 13.6V 32CAPRS
SRC: [9M2CCC-3] PATH: [WIDE2-1] DATA: !/Lqluh1'q# st 11.8V  33C MAAAS VHF 144.3900MHz
SRC: [9W2AAA-0] PATH: [9M4RRR-3] [9M2TTT-1] [9M2KKK-3] [WIDE1-0] DATA: @050418z0300.35N/000004.61Ez
SRC: [9M2KKK-3] PATH: [WIDE2-1] DATA: !/Lqluh1'q# st 11.8V  33C MAAAS VHF 144.3900MHz

The decodeAPRS functions, the entire source codes are at the github URL stated above ...
Code:
void decodeAPRS() {
      char c;
      char endChar = '\n';
      char endChar2 = '\r';
      boolean storeString = true;
      char callsign[12];
      char path[60];
      char data[100];

      debug.println();
      debug.print("Entering decodeAPRS (");
      debug.print(millis());
      debug.println(")");
      while ( Serial.available() > 0 ) {
         c = Serial.read();
         // For debugging only
         debug.print(c);
         
         // If MAXBUFFER is reach, NULL terminate the string
         if ( bufferIndex > maxBuffer ) {
               charBuffer[maxBuffer] = 0;
               storeString = false;         
         }
         
         // Check for endChar and NULL terminate the string
         if ( c == endChar || c == endChar2 ) {
             charBuffer[bufferIndex] = 0;
             storeString = false;   
         }
         
         if ( storeString ) {
              charBuffer[bufferIndex++] = c;
         }
      }
     
      // Save buffers into Strings if charBuffer is not blank
      if ( !storeString  && (!charBuffer[0] == 0) ) {
            inBuffer = charBuffer;
      }
     
      if ( inBuffer != "" && !storeString ) {
        debug.println();
        debug.print("RF(");
        debug.print(inBuffer.length());
        debug.print("):");
        debug.println(inBuffer);
       
        // Check for first 3 char is SRC
        if ( inBuffer.substring(0,3) == "SRC" ) {
     
        int firstBracket = inBuffer.indexOf('[');  // Anything in between [ and ] is the callsign & ssid
        int secondBracket = inBuffer.indexOf(']');

        //int secondColon = inBuffer.indexOf(':',secondBracket+1); 
        int secondColon = secondBracket+6;
        // Do not use lastindexOf as the messaging uses : too
        int thirdColon = inBuffer.indexOf(':',secondColon+1);
       
        // Get the callsign
        String decoded2 = inBuffer.substring(firstBracket+1,secondBracket); // Substring the callsign
        decoded2.toCharArray(callsign,secondBracket+1-firstBracket-1);      // Convert to char array
       
        // Get the path
        String decoded3 = inBuffer.substring(secondColon+2,thirdColon-5);
        decoded3.toCharArray(path,decoded3.length()+1);
       
        // Get the data
        String decoded4 = inBuffer.substring(thirdColon+2,inBuffer.length());
        decoded4.toCharArray(data,decoded4.length()+1);

        debug.print("Callsign (");
        debug.print(strlen(callsign));
        debug.print("):");
        debug.println(callsign);   
             
        debug.print("Path (");
        debug.print(strlen(path));
        debug.print("):");
        debug.println(path);   

        debug.print("Data (");
        debug.print(strlen(data));
        debug.print("):");
        debug.println(data);   
       
        lcd.clear();
        lcd.setCursor(0,0);
        lcd.print(callsign);
       
        lcd.setCursor(0,1);
        lcd.print("                    ");       
        lcd.setCursor(0,1);
        for ( int i=0;i<20;i++ ) { lcd.print(data[i]); }

        // Print on Line 2
        lcd.setCursor(0,2);
        lcd.print("                    ");       
        lcd.setCursor(0,2);       
        if ( strlen(data) < 40 ) {
            for ( int i=20;i<strlen(data);i++ ) { lcd.print(data[i]); }
        } else {
            for ( int i=20;i<40;i++ ) { lcd.print(data[i]); } // Truncate data till 40 bytes
        }
                 
        firstBracket, secondBracket, secondColon, thirdColon = 0;
       
       } // endif SRC check
       
        // clear the buffers after saving out all the variables like callsign, path and data
        inBuffer = "";      // Clear the buffers
        charBuffer[0] = 0;  // Clear the buffers
        bufferIndex = 0;    // Reset the index
        callsign[0] = 0;
        path[0] = 0;
        data[0] = 0;
       
      } // end storeString
}

15  Using Arduino / Project Guidance / Re: Calculating turning degree in tinyGPS++ on: July 14, 2014, 03:18:18 pm
Code:
int headingDelta = ((previousHeading - currentHeading) + 360) % 360;
if (headingDelta < -25 || headingDelta > 25) {
     // report position
    previousHeading = currentHeading
}

Dear John, for your formula, when I debug it.. it seems the calculation is wrong..  ( very obvious )

previousHead = 54
currentHead = 72
headDelta = 342

previousHead = 78
currentHead = 91
headDelta = 347

previousHead = 192
currentHead = 195
headDelta = 358

Here are my suggested codes to fix it , will the below formula work ?

Code:

    if ( gps.course.isUpdated() ) {   
      // Get headings and heading delta
      currentHeading = (int) gps.course.deg();
      if ( currentHeading >= 180 ) { currentHeading = currentHeading-180; }
      headingDelta = (int) ( previousHeading - currentHeading ) % 360;
    } // endof gps.course.isUpdated()


    if ( lastTx > 5000 && (gps.satellites.value() > 3) ) {
      if ( headingDelta < -25 || headingDelta >  25 ) {
          debug.println();       
          debug.print("Heading, current:");     
          debug.print(currentHeading);
          debug.print(" previous:");     
          debug.print(previousHeading);
          debug.print(" delta:");     
          debug.println(headingDelta);
       
          debug.println("*** Trigger by Heading Change");
          TxtoRadio();
          previousHeading = currentHeading;
       }
    }

Pages: [1] 2 3 ... 14