mackrackit's ConnectOne example code


Closed Thread
Results 1 to 40 of 92

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: mackrackit's ConnectOne example code

    I am not familiar with Sparkfun stuff, that module converts 5 to 3? Why not just run the whole thing from a 3 volt supply and be done with it?

    Is your router set for DCHP? Does it see a new device?

    I have always used the ConnectOne software to set the passkey and baud rate.

    When I get back to the shop I will look at this closer.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Re: mackrackit's ConnectOne example code

    My application is also using a SRF02 ultrasonic ranger sensor as controlled by my 16F886 MCU. The SRF02 will only work on 5v so I made the choice of running the MCU also at 5v and then I had to use the Sparkfun level converter between it and the ConnectOne iWiFi module.

    I will double check my router setting for DCHP.

    What code are you referring to from ConnectOne to set the passkey and baud rate? Can you share or point me to it with a URL?

    I really appreciate your looking at my code.

    John

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: mackrackit's ConnectOne example code

    Up date..
    Trying to set up the iChip using only AT commands like you are. Not having much luck. Have to get back to work. Will continue later.
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924

    Default Re: mackrackit's ConnectOne example code

    Up date..<br>Trying to set up the iChip using only AT commands like you are. Not having much luck. &nbsp;Have to get back to work. Will continue later.

  6. #6
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Re: mackrackit's ConnectOne example code

    Dave, I began to wonder if in my process of converting your ConnectOne example code to my 16F886 MCU and my parsing of the code into subroutines that I could call from my application might have done something that screwed up its ability to communicate with the iChip module. So I went back to your original example code which is a lot simpler and modified it slightly so it is supposedly compatible with 16F886, without parsing into subroutines. Below is the resulting code where I have annotated where it stops and won't execute any further. Still looks like I can't get communication with the iChip. Would appreciate you trying it to see if you can get it to communicate with your module.

    I also tried using the AT+iFD command to reset the iChip
    to Factory Defaults, in hopes that it would connect.....I did this because of this quote in the iChip WiFi Configuration Manual which says " Assuming all WiFi related parameters are cleared to their default value, as is the case after a Factory-Defaults setting (AT+iFD), iChip will attempt to associate and connect to the closest available Access Point (AP) that does not have any security configured. " I used this statement to try to do this and it won't even compile as if there is a syntax error: SEROUT2 TX,6 [ "AT+iFD",$d ,$a ] 'Set iChip to Factory Defaults
    I don't see anything wrong with this. Any ideas why this won't compile?


    'Adapted from http://mackrackit.com/mac/ichip/ichip.html
    'Every 60 seconds OR so the PIC sends the commands TO the iChip TO FTP a file along with a new number in the file.
    'Every 60 seconds OR so the page will reload with a new number generated by a PIC.
    'Every 60 minutes OR so the DATA IS also emailed.

    'The PIC code which will compile:
    '#####################################
    '< FL_PIC16F886 >' ' First valid PIC found within the first 200 lines will
    ' highlight AND set device.
    '< FL_PBPW >' ' OR < FL_PBPL >
    '< FL_MPASM >' ' OR < FL_PM >
    ' Set configuration fuses for the MCU
    ' To use standard config include file, comment out below statement
    @ __config _CONFIG1, _HS_OSC & _WDT_OFF & _MCLRE_OFF & _LVP_OFF & _CP_OFF
    ASM
    ERRORLEVEL -306
    ENDASM

    DEFINE OSC 8
    ADCON1 = %00001110
    TRISC.4 = 0 ' Used as output for LED_GRN
    TRISC.5 = 0 ' Used as output for LED_RED
    TRISC.6 = 0 ' Used as output for serial TX
    TRISC.7 = 1 ' Used as input for serial RX

    ' Define variables and aliases
    CNT VAR BYTE
    CNT = 0
    temp VAR BYTE 'Already declared in main program as temp
    D_LAY VAR BYTE
    ADR VAR BYTE [9]
    TX VAR PORTC.6
    RX VAR PORTC.7
    PAUSE 2000

    BOOT: 'iCHIP SET UP
    ' Blink LED_GRN 1x LONG
    HIGH PORTC.5 :PAUSE 1000
    LOW PORTC.5: PAUSE 2000
    'SEROUT2 TX,6 [ "AT+iFD",$d ,$a ] 'Set iChip to Factory Defaults
    WRITE 2,2 'Above statement won't compile when uncommented
    SEROUT2 TX,6,[ "AT+I",$d ,$a] 'Verify that the iChip is communicating
    WRITE 3,3 'EEPROM test to see if program executes to here..it does.
    SERIN2 RX,6,2500,BROKE,[ WAIT("I/OK") ]
    WRITE 4,4 'EEPROM test to see if program executes to here..IT DOESN'T!
    SEROUT2 PORTC.3 , 16780 , [ "iChip OK" ]
    SEROUT2 PORTC.3 , 16780 , [ "TEST_" , DEC3 CNT , 13 , 10 ]
    SEROUT2 TX ,6 , [ "AT+iIPA?" , $d , $a ] 'Report the current IP address
    SERIN2 RX ,6 , 2500 ,BOOT , [ DEC ADR[0] , DEC ADR[1] , DEC ADR[2] , DEC ADR[3] ] 'Store IP in array
    GOSUB DIP ' If IP address is empty, report not connected
    PAUSE 2000
    SEROUT2 TX,6,["AT+iWWW",$d,$a] 'Activate iChip s internal web server
    SERIN2 RX,6,1000,BOOT,[WAIT("I/(")] ' 1 sec timout to BOOT label..I/(<Local IP addr>)where,<Local IP addr> IS the iChip local IP address
    EMAIL_SET:
    SEROUT2 TX,6,["AT+iSBJ:iChip ADC TEMPERATURE",$d,$a] 'Permanently sets Email header s Subject field
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iTOA:[email protected]",$d,$a] 'Permanently sets Email addressee
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+ito:jellis00",$d,$a] 'Permanently sets Email header s =To: description
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iREA:[email protected]",$d,$a] 'Permanently sets the RETURN EMAIL Address
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iFRM:iChip",$d,$a] 'Permanently sets Email header =From: description.
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iSMTP:mail.comcast.com",$d,$a]'Sets the SMTP Server Name or IP.
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iSMA=1",$d,$a] 'Permanently sets SMTP authentication method
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iSMP:Kevin111",$d,$a] 'Permanently sets authenticated SMTP login
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    SEROUT2 TX,6,["AT+iSMU:[email protected]",$d,$a]'Permanently sets Authenticated SMTP login User Name.
    SERIN2 RX ,6,2500,EMAIL_SET,[WAIT("I/OK")]
    FTP:
    CNT = CNT + 1
    FOR D_LAY = 1 TO 12
    PAUSE 5000
    NEXT D_LAY
    IF CNT = 2 THEN EMAIL
    IF CNT > 60 THEN CNT = 0
    GOTO BOOT
    END

    EMAIL:
    SEROUT2 TX,6,["AT+iEMA:",$d,$a] 'Defines a plain text e-mail body
    SEROUT2 TX,6,["HI, THIS IS FROM 206 N Veterans.",$d,$a]
    SEROUT2 TX,6,["SENT EVERY HOUR.",$d,$a]
    SEROUT2 TX,6,["THE TEMPERATURE IS.",$d,$a]
    SEROUT2 TX,6,[DEC temp," F Inside.",$d,$a]
    SEROUT2 TX,6,["GO TO:",$d,$a]
    SEROUT2 TX,6,["http://www.lodestarassoc.com/ichip/ichip.html",$d,$a]
    SEROUT2 TX,6,["FOR A ONE MINUTE UPDATE.",$d,$a]
    'After successfully sending the e-mail, IF the stay online flag (!) IS specified.
    SEROUT2 TX,6,[$d,$a,".",$d,$a]
    SERIN2 RX,6,[WAIT("I/ONLINE")]
    PAUSE 1000
    GOTO BOOT

    DIP:
    IF !ADR[1] AND !ADR[1] AND !ADR[2] AND !ADR[3] THEN SEROUT2 PORTC.3,16780,[" NOT "]
    SEROUT2 PORTC.3,16780,[" CONNECTED ",$d,$a]
    SEROUT2 PORTC.3,16780,["ADR - " ,DEC3 ADR[0],".",DEC3 ADR[1],".",DEC3 ADR[2],".",DEC3 ADR[3],$d,$a]
    PAUSE 1000
    RETURN

    BROKE:
    SEROUT2 PORTC.3 ,16780,["NOT WORKING",$d,$a]
    PAUSE 500
    GOTO BOOT

    GET_T:
    ADCON0=00000001
    GOSUB READ_AD
    temp = ADRESH
    temp = temp * 2
    RETURN

    READ_AD:
    PAUSE 50
    ADCON0.2=1
    WHILE ADCON0.2=1:WEND
    RETURN




  7. #7
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Re: mackrackit's ConnectOne example code


    I used this statement to try to do this and it won't even compile as if there is a syntax error: SEROUT2 TX,6 [ "AT+iFD",$d ,$a ] 'Set iChip to Factory Defaults
    I don't see anything wrong with this. Any ideas why this won't compile?
    I at least figured out why this statement wouldn't compile....I forgot to put a comma after the SEROUT2 TX,6 . However, after fixing this and compiling/running it, the factory defaults didn't seem to happen.

    I may have found part of the problem. I have placed a voltmeter on the pin that is RX going into the iWiFi and it stays at a constant 3.3 volts throughout this program...no fluctuations indicating any serial transmission. Also put it on the TX pin comming out of my MCU...also constant. This tells me that the serial interface from the MCU is not working. That would mean that the AT+iFD message never got to the module, hence no Factory Defaults. However, I don't know why or how to fix it. Any ideas?

  8. #8
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378

    Default Re: mackrackit's ConnectOne example code

    Do you have a URL link that will get me to where I can download the iChipConfig utilility and its user manual?

    I will have to use it on a Windows XP lapto. My application PCB doesn't have a serial interface to it that I can use to connect to PC terminal. Does that mean I can't use iChipConfig utility?

    Here is a URL to the SparkFun level converter. http://www.sparkfun.com/products/8745

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts