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

    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

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

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

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

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

    Default Re: mackrackit's ConnectOne example code

    The code was tested on a ConnectOne Nano Socket. Same chipset as far as I know.

    Yup, I am implying bugging in a DB9.

    I used one of these while debugging the above code on a win7 netbook. But I agree, the converters are not good for everything and I have brands that do not work at all.

    Or you could get a LCD with a serial back-pack to see what is going on. Either way, it will sure make debugging faster.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Nov 2011
    Posts
    26

    Default Re: mackrackit's ConnectOne example code

    hello john is it ok to use the the 16F873A?...uhm sir is it ok to disconnect the PICKIT2 when your are done load it to ur PIC?tnx

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

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

    Default Re: mackrackit's ConnectOne example code

    The only pins used for normal operation are the GND, VDD, RXD0, and TXD0. All others are left floating.

    You are keeping things in reset by playing with the other pins.
    Dave
    Always wear safety glasses while programming.

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

    Default Re: mackrackit's ConnectOne example code

    I understand your point, Dave, but I already built the PCB with hookups to MSEL and _RES_PD from the MCU so have to make them work in the setup.

    This code works! The fix was to set TRISC so that _RES_PD and MSEL were declared as outputs. When this worked I was able to read the EEPROM to see what the IP was for the iChip website that it established and then to got to it via http://xx.xx.x.xxx/ichip and set the parameters I wanted.
    Now on to figure out how to integrate this working code into my application so I can use the iWiFi module to send an email via its connection with my wireless router to the internet.
    Thanks for your help, Dave. I hope this attached code will show others who visit this thread how to setup a iWiFi MiniSocket module to set its parameters without having to use the config utility.
    /s/ John Ellis
    Code:
    ' STATUS:  Works OK!
    '< 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.1 = 0           ' Make pin output for MSEL
    TRISC.2 = 0           ' Make pin output for _RES_PD
    ' 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 AT+i command 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   ' while disconnected from router.
    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 does!
            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
                     ' Commented out until WPA setup on wireless router
            '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
                     ' Commented out until WPA setup on wireless router
            '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
                                                     ' FOR DEBUGGING
            SERIN2 RX ,84 , 2500 ,BOOT , [ DEC ADR[0] , DEC ADR[1] , DEC ADR[2] , DEC ADR[3] ]
            PAUSE 100
            WRITE 16,ADR[0]      ' Write the IP to EEPROM for post run identify
            WRITE 17,ADR[1]
            WRITE 18,ADR[2]
            WRITE 19,ADR[3]
    WRITE 6,6      'EEPROM test to see if program executes to here..it does!
            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..IT DOES AFTER ~2 minutes!
        LOW PORTC.5: PAUSE 500
       RETURN

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

    Default Re: mackrackit's ConnectOne example code

    Glad you got it working!!!

    But,
    TRISC.1 = 0 ' Make pin output for MSEL
    TRISC.2 = 0 ' Make pin output for _RES_PD

    Would/should not have made a difference because the HIGH/LOW commands do that in the background.

    Must have been another change...
    Dave
    Always wear safety glasses while programming.

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

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

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

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

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

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

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

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

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

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

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

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

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

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