mackrackit's ConnectOne example code


Closed Thread
Results 1 to 40 of 92

Hybrid View

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

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

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

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

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

    Default Re: mackrackit's ConnectOne example code

    Can you solder a couple of wire onto your board?
    Dave
    Always wear safety glasses while programming.

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

    Default Re: mackrackit's ConnectOne example code

    I finally got back to this.
    To set the iChip up for you network change the below as needed. The config utility is not needed.
    Code:
    TX  VAR PORTC.0    'ICHIP PIN 8
        RX  VAR PORTC.1     'ICHIP PIN 7
        PAUSE 2000
        
        BOOT:   'iCHIP SET UP      
            SEROUT2 TX,84,["AT+iBDRA",$d,$a]        ' FORCE ICHIP TO AUTO BAUD
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]  ' SETTING BAUD TO 9600
            PAUSE 100
            SEROUT2 TX,84,["AT+iRPG=booger",$d ,$a] ' SETS REMOTE PASSWORD
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]
            PAUSE 100
            SEROUT2 TX,84,["AT+iWSEC=0",$d ,$a]     ' WPA-TKIP PROTOCAL
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]
            PAUSE 100
            SEROUT2 TX,84,["AT+iWLSI=MACLAN2",$d,$a]' SET SSID WE ARE LOOKING FOR
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]  ' 
            PAUSE 100
            SEROUT2 TX,84,["AT+iWLPP=macmac3X3",$d,$a]' SET PASS-PHRASE
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]  
            PAUSE 100 
            SEROUT2 TX,84,["AT+i!RP10",$d,$a]        ' REPORTS CONNECTION PARAMETERS
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]   ' FOR DEBUGGING
            PAUSE 100
            SEROUT2 TX ,84,[ "AT+iIPA?" , $d , $a ]  ' RETURNS IP ADDRESS
            PAUSE 100                               ' FOR DEBUGGING
            SEROUT2 TX,84,["AT+iWWW",$d,$a]         ' STARTS WEB SERVER
            SERIN2 RX,84,1000,BOOT,[WAIT("I/(")]
            PAUSE 100
            GOSUB BLINK                             ' IF WE GET HERE BLINK
            PAUSE 100
       GOTO BOOT
    It may take a minute or two to get a connection and "blink".
    Then look at your router and find a new device address.
    Enter the address into a browser
    http://192.168.2.19/ichip

    You should have the web config page.
    Dave
    Always wear safety glasses while programming.

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

    Default Re: mackrackit's ConnectOne example code

    Does this code actually work with one of your ConnectOne MiniSockets?
    I will try this with mine. If it works with yours and not with mine, this may be a way I can verify whether my module has gone bad or not...which is unforunately one of my increasing suspicions.
    John

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

    Default Re: mackrackit's ConnectOne example code

    Quote Originally Posted by mackrackit View Post
    It may take a minute or two to get a connection and "blink".
    I modified your proven code you inserted above very slightly per below. Because my PCB has the _RES_PD and MSEL interfaces connected to MCU pins for control of the module, I had to insert the "Initialize" statements for those interfaces per programmers manual to supposedly have module in normal AT+i ops for the internal serial interface. I also inserted some WRITE to EEPROM statements with comments and some LED blinking to assist my troubleshooting.

    As you can see from the comments, I never get the first I/OK acknowledgment from the module, which tells me that the internal serial interface from my MCU to the module is not working.

    Next step I guess is to solder 3 wires to my PCB to provision a temporary serial interface to my PC to see if Serial interface is working from MCU. Any other suggestions?

    Code:
    '< 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
    ' 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]
    MSEL     VAR PORTC.1   ' iChip Mode Select (MSEL)
    _RES_PD  VAR PORTC.2   ' iCHIP RESET/Power-Down (_RES_PD)
    TX       VAR PORTC.6
    RX       VAR PORTC.7
    PAUSE 2000
    'Initialize iWiFi MiniSocket Module
        HIGH _RES_PD     ' Set high for normal ops
        PAUSE 500        ' Delay to stabilize coming out of power down mode
        LOW MSEL         ' Exit SERIALNET mode and return iChip to normal AT+i mode
        PAUSE 10000      ' Delay 10 sec
        HIGH MSEL        ' Proceed with normal ops
        PAUSE 2000       ' Delay 2 sec
    
    BOOT: 'iCHIP SET UP
        HIGH PORTC.4 :PAUSE 500  ' Short Blink the LED_RED as heart beat
        LOW PORTC.4: PAUSE 500
    WRITE 3,3      'EEPROM test to see if program executes to here..it does.
            SEROUT2 TX,84,["AT+iBDRA",$d,$a]        ' FORCE ICHIP TO AUTO BAUD
    WRITE 4,4      'EEPROM test to see if program executes to here..it does.
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]  ' SETTING BAUD TO 9600
            PAUSE 100
    WRITE 5,5      'EEPROM test to see if program executes to here..IT DOESN'T!
                   ' It just keeps looping to BOOT and blinking LED_RED
            SEROUT2 TX,84,["AT+iRPG=booger",$d ,$a] ' SETS REMOTE PASSWORD
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]
            PAUSE 100
            'SEROUT2 TX,84,["AT+iWSEC=0",$d ,$a]     ' WPA-TKIP PROTOCAL
            'SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]
            PAUSE 100
            SEROUT2 TX,84,["AT+iWLSI=Buckskin",$d,$a]' SET SSID WE ARE LOOKING FOR
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]  '
            PAUSE 100
            'SEROUT2 TX,84,["AT+iWLPP=macmac3X3",$d,$a]' SET PASS-PHRASE
            'SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]
            PAUSE 100
            SEROUT2 TX,84,["AT+i!RP10",$d,$a]        ' REPORTS CONNECTION PARAMETERS
            SERIN2 RX ,84,2500,BOOT,[WAIT("I/OK")]   ' FOR DEBUGGING
            PAUSE 100
            SEROUT2 TX ,84,[ "AT+iIPA?" , $d , $a ]  ' RETURNS IP ADDRESS
            PAUSE 100                               ' FOR DEBUGGING
            SEROUT2 TX,84,["AT+iWWW",$d,$a]         ' STARTS WEB SERVER
            SERIN2 RX,84,1000,BOOT,[WAIT("I/(")]
            PAUSE 100
            GOSUB Blink                             ' IF WE GET HERE BLINK LED_GRN
            PAUSE 100
       GOTO BOOT
       Blink:
        HIGH PORTC.5 :PAUSE 500  ' Short Blink the LED_GRN..NEVER GETS HERE!
        LOW PORTC.5: PAUSE 500
       RETURN
    Last edited by jellis00; - 15th October 2011 at 23:35.

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

    Default Re: mackrackit's ConnectOne example code

    Quote Originally Posted by mackrackit View Post
    Can you solder a couple of wire onto your board?
    a

    I think I know where you are going with this, Dave. Are you implying that if I solder 3 individual wires to the pins on my PCB that are TX, RX and GND and then connect those three wires to a DB-9 connector, I can jurry-rig a serial interface to my PCB?

    I could do this if that is what you are implying, but I also have the problem that none of our computers have a serial interface on them....they are all newer computers and it seems that only older computers have RS-232. I supposed we could try to use a USB to RS-232 converter cable, but we have had very bad experience in trying to use those...they typically don't work well with serial applications.

    John

  10. #10
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    Hello sir john.. i would to know if the minisocket need an external antenna?or is it ok without extrnal antenna?tnx..

  11. #11
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    uhm..Sir what must be use in oscillator is it ok 4mhz or 8mhz?..what software do you use to load into pic18f4550 sir?...

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

    Default Re: mackrackit's ConnectOne example code

    The internal 8MHz oscillator is fine for this.
    I use a PicKit2 to load the hex file onto the 4550.
    Dave
    Always wear safety glasses while programming.

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

    Default Re: mackrackit's ConnectOne example code

    Quote Originally Posted by kenruizal View Post
    uhm..Sir what must be use in oscillator is it ok 4mhz or 8mhz?..what software do you use to load into pic18f4550 sir?...
    I use an 8mhz external crystal with capacitors as shown in the schematic I will post with this. Like mackrackit, I also use the Pickit2 to load programs into my 18F4550.
    Attached Images Attached Images  

  14. #14
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    Sir do you have a schematic how u connect the max232 in iwifi connectone to interface in PC?

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

    Default Re: mackrackit's ConnectOne example code

    I can not find my schematic but...

    Using the Nano Socket IWifi.

    Header J8 iWifi pin 8 connect to pin 12 max232
    Header J8 iWifi pin 9 connect to pin 11 max 232

    Max232 pin 13 connect to PC DB9 pin 3
    Max232 pin 14 connect to PC DB9 pin 2

    And the grounds (zero rail) are all common.
    Dave
    Always wear safety glasses while programming.

  16. #16
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    Ok sir..tnx..Sir mackrackit in your program and design? are u using iconfig to send to ur website and email..?tnx sir

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

    Default Re: mackrackit's ConnectOne example code

    Quote Originally Posted by kenruizal View Post
    Ok sir..tnx..Sir mackrackit in your program and design? are u using iconfig to send to ur website and email..?tnx sir
    Not sure I understand the question. This thread has all kinds of code showing how do send email and do FTP.
    Dave
    Always wear safety glasses while programming.

  18. #18
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    Helo Sir...what software connectone u use to convert the HTML to image file?what is the name of software..tnx sir

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

    Default Re: mackrackit's ConnectOne example code

    The Config Utility has the program used to do the conversion.
    Dave
    Always wear safety glasses while programming.

  20. #20
    Join Date
    Jul 2011
    Posts
    35

    Default Re: mackrackit's ConnectOne example code

    Hi,
    I just ordered a Connect One SocketLAN, and am doing some background searching for tips on how to hook it up to a PIC project. It looks like the serial pins are the most basic but am a little in the dark about the above conversation. Should I be adding hardware/provisions for a MAX232 circuit to talk to a terminal program too, and if so, how should it connect... to the PIC, or to the SocketLAN? I see Macrackit's code examples, but it doesn't tell me anything about how the hardware is connected. This is my first attempt at an ethernet project, and don't want to miss anything critical as I'm mulling over a board layout. I plan to start off with the PIC's serial connection to the SocketLAN for simple emails etc.

    Anybody have a simple hookup drawing, or can explain what this terminal connection you're talking about is?

    Thanks

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

    Default Re: mackrackit's ConnectOne example code

    Start at the beginning of the thread.
    Dave
    Always wear safety glasses while programming.

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

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