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

    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.

  2. #2
    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.

  3. #3
    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




  4. #4
    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?

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

    Default Re: mackrackit's ConnectOne example code

    I changed all the SEROUT2 TX statements in the code to mode 396 to lower the baud rate to 2400 to see if this made the serial interface work. Still doesn't appear to work. BAFFLED!!
    Is there any way to tell whether the asynchronous serial interface on a PIC chip that is using PortC.6 and PortC.7 is working?? I don't have an external serial interface to my PCB to use to see if it is working with a PC terminal or I would. I have the TX and RX pins hooked up only internally to the iChip module.

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

    Default Re: mackrackit's ConnectOne example code

    Post #32 has the link to the config utility. You will need a serial interface to your PC to use it along with a MAX232. A USB to serial adapter works fine.

    A USB to serial adapter will also let you test you TX, also will help in debugging.

    Hang in there, we will get this figured out.
    Dave
    Always wear safety glasses while programming.

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

    Default Re: mackrackit's ConnectOne example code

    Just received the below email for ConnectOne tech support confirming what you said about Config utility, so looks like the option is out for me since I don't have an external serial interface on my board.

    From what I know now, my problem is really getting the PIC to establish serial communications on my board with my code to the iChip. Once that is done I should be able to use the http:// approach he mentions in the email to setup the iChip configuration. So if you ca help me figure out why the PIC isn't executing the serial interface, that will be the big step.
    Regards, John

    Here is their email:
    Hi John,

    According to our R&D, the LAN to WiFi Wizard is not operational and should not be used (it should have been removed from the s/w).

    To configure the unit either use the FULL CONFIGURATION tool in the iChipConfig or manually type in AT+I commands using the “Dumb terminal”.
    Once the unit is configured, it will save the parameters in non volatile memory.
    You will need to power down the unit for the parameters to take effect.

    Once you’ve setup the module for the AP you want to connect to and enabled the internal web server, you can than access directly the ichip web configuration page via http://x.x.x.x/ichip

    All the information you need for setting up the module is available in the documentation I previously sent you.

    Best regards,
    Daniel Doron
    Customer Support & FAE Manager

    Connect One
    20 Atir Yeda st.
    Kfar Saba 44643 Israel
    Phone: 972-9-7660456 x138

  8. #8
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    Hello john and mackrackit..if it is ok to you..can i have ur schematic in full...tnx

  9. #9
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    john...what is best to be used it is with evaluation board or without evaluation board mini socket iwifi?

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