|
STM32 lwIP PPPoS, STM32 lwIP PPPoS |
|
|
|
Jul 9 2012, 16:53
|
Участник

Группа: Участник
Сообщений: 33
Регистрация: 29-06-10
Пользователь №: 58 196

|
Не знаю, существуют ли русскоязычные гуру в PPP, но рискну. На STM32F407 крутится FreeRTOS с lwIP. Пытаюсь установить PPP-соединение, но оно не устанавливается до конца. Собрал с выводом диагностической информации (лог - ниже), но интерпретировать не могу. Видел в интернете, что у людей возникают схожие проблемы, но решений и у них нет. Помогите пожалуйста найти решение проблемы. Пакеты фрагментируются, та как приходится перенаправлять траффик с USB-модема, подключённого к компьютеру, на устройство и обратно. Скрипт в режиме поллинга с периодом 0.1 секунды читает и пишет из виртуального COM-порта USB-модема в COM-порт, к которому подключено устройство, и наоборот. Думаю пакеты из байтов должны нормально собираться. sio_read не бесконечно блокирующая, стоит таймаут 1.5 секунды. Иначе вообще ничего не получается. CODE send: 'ATZ0 E0 V0' recv: 0 send: 'ATS0=0' recv: 0 send: 'AT+CGDCONT=1,"IP","internet.mts.ru"' recv: 0 send: 'ATDT*99#' recv: 1 lcp_init: xmit_accm=0 0 0 0 upap_init: 0 pppOverSerialOpen: unit 0: Connecting pppStart: unit 0 ppp_set_xaccm[0]: outACCM=0 0 0 0 ppp_send_config[0]: outACCM=FF FF FF FF ppp_recv_config[0]: inACCM=0 0 0 0 lcp_lowerup: asyncmap=0 0 0 0 LCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED) auth_reset: 0 lcp_addci: L opt=2 0 lcp_addci: L opt=5 52181044 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=47 fsm_sdata(LCP): Sent code 1,1,20. LCP: sending Configure-Request, id 1 LCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT) pppStart: finished pppInProc[0]: got 154 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,224,25 fsm 0 lcp_addci: L opt=5 33CF11CE lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=46 fsm_sdata(LCP): Sent code 1,2,20. LCP: sending Configure-Request, id 2 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=53 fsm_sdata(LCP): Sent code 2,225,25. pppInput[0]: packet processed pppInProc[0]: got 153 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,226,25 fs2 0 lcp_addci: L opt=5 F7BDAD33 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=44 fsm_sdata(LCP): Sent code 1,3,20. LCP: sending Configure-Request, id 3 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,227,25. pppInput[0]: packet processed pppInProc[0]: got 151 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,228,25 fsm 0 lcp_addci: L opt=5 246375C lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=45 fsm_sdata(LCP): Sent code 1,4,20. LCP: sending Configure-Request, id 4 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,229,25. pppInput[0]: packet processed pppInProc[0]: got 153 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,230,25 fs2 0 lcp_addci: L opt=5 E236C5DD lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=44 fsm_sdata(LCP): Sent code 1,5,20. LCP: sending Configure-Request, id 5 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,231,25. pppInput[0]: packet processed pppInProc[0]: got 152 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,232,25 fsm 0 lcp_addci: L opt=5 8E005B91 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=46 fsm_sdata(LCP): Sent code 1,6,20. LCP: sending Configure-Request, id 6 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,233,25. pppInput[0]: packet processed pppInProc[0]: got 153 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,234,25 fs2 0 lcp_addci: L opt=5 37DA08AA lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=45 fsm_sdata(LCP): Sent code 1,7,20. LCP: sending Configure-Request, id 7 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,235,25. pppInput[0]: packet processed pppInProc[0]: got 152 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,236,25 fsm 0 lcp_addci: L opt=5 7D452883 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=46 fsm_sdata(LCP): Sent code 1,8,20. LCP: sending Configure-Request, id 8 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,237,25. pppInput[0]: packet processed pppInProc[0]: got 154 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,238,25 fs2 0 lcp_addci: L opt=5 BB77512B lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=44 fsm_sdata(LCP): Sent code 1,9,20. LCP: sending Configure-Request, id 9 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=53 fsm_sdata(LCP): Sent code 2,239,25. pppInput[0]: packet processed pppInProc[0]: got 151 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,240,25 fsm 0 lcp_addci: L opt=5 320709B8 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=47 fsm_sdata(LCP): Sent code 1,10,20. LCP: sending Configure-Request, id 10 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,241,25. pppInput[0]: packet processed pppInProc[0]: got 154 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,242,25 fst=2 0 lcp_addci: L opt=5 874F608F lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=44 fsm_sdata(LCP): Sent code 1,11,20. LCP: sending Configure-Request, id 11 lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (19972D3) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=52 fsm_sdata(LCP): Sent code 2,243,25. pppInput[0]: packet processed pppInProc[0]: got 2 bytes LCP: timeout resending Config-Request state=8 (LS_ACKSENT) lcp_addci: L opt=2 0 lcp_addci: L opt=5 874F608F lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=45 fsm_sdata(LCP): Sent code 1,11,20. LCP: sending Configure-Request, id 11 pppClose() called pppClose: unit 0 kill_link -> pppStop pppStop: unit 0 pppWrite[0]: len=29 fsm_sdata(LCP): Sent code 5,12,16. LCP: close reason=User request state 8 (LS_ACKSENT) -> 4 (LS_CLOSING) pppRecvWakeup: unit 0 LCP: timeout resending Terminate-Requests state=4 (LS_CLOSING) pppWrite[0]: len=29 fsm_sdata(LCP): Sent code 5,13,16. LCP: timeout sending Terminate-Request state=4 (LS_CLOSING) link_terminated: 0 Connection terminated. pppLinkTerminated: unit 0 pppRecvWakeup: unit 0 pppLinkTerminated: unit 0: linkStatusCB=0x800de11 errCode=-5 pppLinkTerminated: finished.
Сообщение отредактировал IgorKossak - Jul 9 2012, 18:48
Причина редактирования: [codebox] для длинных простыней!!!
|
|
|
|
|
 |
Ответов
|
Jul 17 2012, 03:35
|
Участник

Группа: Участник
Сообщений: 33
Регистрация: 29-06-10
Пользователь №: 58 196

|
мда. ступенька на каждом шагу. уважаемый kan35, не могли бы вы намекнуть на причины следующей проблемы: после переговоров PPP (после получения IP-адресов в IPCP переговорах) lwIP уже создан ppp-интерфейс, потому я создаю netconn TCP соединение (например на порт 80 одного из IP google.com), но IP соединение не создаётся, так как нет ответа от сайта. вот лог: CODE lcp_init: xmit_accm=0 0 0 0 upap_init: 0 tx dump (2/2): 41 54 AT rx dump (0/256):
tx dump (2/2): 0D 0A .. rx dump (3/256): 30 00 0D 0.. tx dump (11/11): 41 54 20 5A 30 20 45 30 20 56 30 AT.Z0.E0.V0 rx dump (0/256):
tx dump (2/2): 0D 0A .. rx dump (3/256): 30 00 0D 0.. tx dump (7/7): 41 54 20 53 30 3D 30 AT.S0=0 rx dump (0/256):
tx dump (2/2): 0D 0A .. rx dump (3/256): 30 00 0D 0.. tx dump (36/36): 41 54 20 2B 43 47 44 43 4F 4E 54 3D 31 2C 22 49 AT.+CGDCONT=1,"I 50 22 2C 22 69 6E 74 65 72 6E 65 74 2E 6D 74 73 P","internet.mts 2E 72 75 22 .ru" rx dump (0/256):
tx dump (2/2): 0D 0A .. rx dump (3/256): 30 00 0D 0.. tx dump (13/13): 41 54 20 44 54 2A 39 39 2A 2A 2A 31 23 AT.DT*99***1# rx dump (0/256):
tx dump (2/2): 0D 0A .. rx dump (3/256): 31 00 0D 1.. pppOverSerialOpen: unit 0: Connecting pppStart: unit 0 ppp_set_xaccm[0]: outACCM=0 0 0 0 ppp_send_config[0]: outACCM=FF FF FF FF ppp_recv_config[0]: inACCM=0 0 0 0 lcp_lowerup: asyncmap=0 0 0 0 LCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED) auth_reset: 0 lcp_addci: L opt=2 0 lcp_addci: L opt=5 52181044 lcp_addci: opt=7 lcp_addci: opt=8 pppWrite[0]: len=47 tx dump (47/47): 7E FF 7D 23 C0 21 7D 21 7D 21 7D 20 7D 34 7D 22 ~.}#.!}!}!}.}4}" 7D 26 7D 20 7D 20 7D 20 7D 20 7D 25 7D 26 52 7D }&}.}.}.}.}%}&R} 38 7D 30 44 7D 27 7D 22 7D 28 7D 22 6E E1 7E 8}0D}'}"}(}"n.~ fsm_sdata(LCP): Sent code 1,1,20. LCP: sending Configure-Request, id 1 LCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT) pppStart: finished rx dump (103/1504): 7E FF 7D 23 C0 21 7D 21 7D 24 7D 20 7D 39 7D 22 ~.}#.!}!}$}.}9}" 7D 26 7D 20 7D 20 7D 20 7D 20 7D 23 7D 25 C2 23 }&}.}.}.}.}#}%.# 7D 25 7D 25 7D 26 7D 24 34 21 7D 26 7D 27 7D 22 }%}%}&}$4!}&}'}" 7D 28 7D 22 FA 7D 5E 7E 7E FF 7D 23 C0 21 7D 22 }(}".}^~~.}#.!}" 7D 21 7D 20 7D 34 7D 22 7D 26 7D 20 7D 20 7D 20 }!}.}4}"}&}.}.}. 7D 20 7D 25 7D 26 52 7D 38 7D 30 44 7D 27 7D 22 }.}%}&R}8}0D}'}" 7D 28 7D 22 85 88 7E }(}"..~ pppInProc[0]: got 103 bytes pppInput[0]: LCP len=25 fsm_input(LCP):1,4,25 fsm_rconfreq(LCP): Rcvd id 4 state=6 (LS_REQSENT) lcp_reqci: rcvd ASYNCMAP=0 CHAP C223,5 MAGICNUMBER (4342106) PCOMPRESSION lcp_reqci: ACCOMPRESSION lcp_reqci: returning CONFACK. pppWrite[0]: len=55 tx dump (55/55): 7E FF 7D 23 C0 21 7D 22 7D 24 7D 20 7D 39 7D 22 ~.}#.!}"}$}.}9}" 7D 26 7D 20 7D 20 7D 20 7D 20 7D 23 7D 25 C2 23 }&}.}.}.}.}#}%.# 7D 25 7D 25 7D 26 7D 24 34 21 7D 26 7D 27 7D 22 }%}%}&}$4!}&}'}" 7D 28 7D 22 77 72 7E }(}"wr~ fsm_sdata(LCP): Sent code 2,4,25. pppInput[0]: packet processed pppInput[0]: LCP len=20 fsm_input(LCP):2,1,20 fsm_rconfack(LCP): Rcvd id 1 state=8 (LS_ACKSENT) lcp_acki: Ack ppp_send_config[0]: outACCM=0 0 0 0 ppp_recv_config[0]: inACCM=0 0 0 0 link_established: unit 0; Lowering up all protocols... upap_lowerup: init 0 clientstate s=0 IPCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED) pppInput[0]: packet processed rx dump (64/1504): 7E FF 7D 23 C0 21 7D 2B 7D 25 7D 20 7D 28 7D 24 ~.}#.!}+}%}.}(}$ 34 21 7D 26 89 5D 7E 7E C2 23 01 01 00 23 10 C0 4!}&.]~~.#...#.. 8F 0D FD 0A 08 59 85 EA 0C 1F 98 AC 24 89 1E 55 .....Y......$..U 4D 54 53 5F 43 48 41 50 5F 53 52 56 52 15 EE 7E MTS_CHAP_SRVR..~ pppInProc[0]: got 64 bytes pppInput[0]: LCP len=8 fsm_input(LCP):11,5,8 fsm_input(LCP): default: pppInput[0]: packet processed pppInput[0]: CHAP len=35 ChapReceiveChallenge: Rcvd id 1. ChapReceiveChallenge: received name field 'UMTS_CHAP_SRVR' pppWrite[0]: len=32 tx dump (32/32): 7E FF 03 C2 23 02 01 00 18 10 C8 E8 44 8E 6D ED ~...#.......D.m. C0 92 00 AC 08 B6 90 6C 94 A5 6D 74 73 65 8A 7E .......l..mtse.~ pppInput[0]: packet processed rx dump (10/1504): 7E C2 23 03 01 00 04 C2 BC 7E ~.#......~ pppInProc[0]: got 10 bytes pppInput[0]: CHAP len=4 ChapReceiveSuccess: Rcvd id 1. auth_withpeer_success: 0 proto=C223 pppWrite[0]: len=30 tx dump (30/30): 7E FF 03 80 21 01 01 00 16 03 06 00 00 00 00 81 ~...!........... 06 00 00 00 00 83 06 00 00 00 00 6E DB 7E ...........n.~ fsm_sdata(IPCP): Sent code 1,1,22. IPCP: sending Configure-Request, id 1 IPCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT) pppInput[0]: packet processed rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (34/1504): 7E 80 21 03 01 00 1C 81 06 0A 0B 0C 0D 83 06 0A ~.!............. 0B 0C 0E 82 06 0A 0B 0C 0D 84 06 0A 0B 0C 0E 41 ...............A 03 7E .~ pppInProc[0]: got 34 bytes pppInput[0]: IPCP len=28 fsm_input(IPCP):3,1,28 fsm_rconfnakrej(IPCP): Rcvd id 1 state=6 (LS_REQSENT) primary DNS address 10.11.12.13 secondary DNS address 10.11.12.14 pppWrite[0]: len=30 tx dump (30/30): 7E FF 03 80 21 01 02 00 16 03 06 00 00 00 00 81 ~...!........... 06 0A 0B 0C 0D 83 06 0A 0B 0C 0E 8B BA 7E .............~ fsm_sdata(IPCP): Sent code 1,2,22. IPCP: sending Configure-Request, id 2 pppInput[0]: packet processed rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
rx dump (34/1504): 7E 80 21 03 02 00 1C 81 06 0A 0B 0C 0D 83 06 0A ~.!............. 0B 0C 0E 82 06 0A 0B 0C 0D 84 06 0A 0B 0C 0E 99 ................ F5 7E .~ pppInProc[0]: got 34 bytes pppInput[0]: IPCP len=28 fsm_input(IPCP):3,2,28 fsm_rconfnakrej(IPCP): Rcvd id 2 state=6 (LS_REQSENT) primary DNS address 10.11.12.13 secondary DNS address 10.11.12.14 pppWrite[0]: len=30 tx dump (30/30): 7E FF 03 80 21 01 03 00 16 03 06 00 00 00 00 81 ~...!........... 06 0A 0B 0C 0D 83 06 0A 0B 0C 0E E7 8D 7E .............~ fsm_sdata(IPCP): Sent code 1,3,22. IPCP: sending Configure-Request, id 3 pppInput[0]: packet processed rx dump (66/1504): 7E 80 21 01 04 00 04 06 A0 7E 7E 80 21 03 02 00 ~.!......~~.!... 16 03 06 0A 41 BA A7 81 06 D5 57 4B 63 83 06 D5 ....A.....WKc... 57 48 9B 0E EB 7E 7E 80 21 03 03 00 16 03 06 0A WH...~~.!....... 41 BA A7 81 06 D5 57 4B 63 83 06 D5 57 48 9B 62 A.....WKc...WH.b DC 7E .~ pppInProc[0]: got 66 bytes pppInput[0]: IPCP len=4 fsm_input(IPCP):1,4,4 fsm_rconfreq(IPCP): Rcvd id 4 state=6 (LS_REQSENT) ipcp_reqci: Requesting peer address ipcp_reqci: returning Configure-NAK pppWrite[0]: len=18 tx dump (18/18): 7E FF 03 80 21 03 04 00 0A 03 06 00 00 00 00 45 ~...!..........E 02 7E .~ fsm_sdata(IPCP): Sent code 3,4,10. pppInput[0]: packet processed pppInput[0]: IPCP len=22 fsm_input(IPCP):3,2,22 fsm_rconfnakrej(IPCP): Rcvd id 2 state=6 (LS_REQSENT) pppInput[0]: packet processed pppInput[0]: IPCP len=22 fsm_input(IPCP):3,3,22 fsm_rconfnakrej(IPCP): Rcvd id 3 state=6 (LS_REQSENT) local IP address 10.65.186.167 primary DNS address 213.87.75.99 secondary DNS address 213.87.72.155 pppWrite[0]: len=29 tx dump (29/29): FF 03 80 21 01 04 00 16 03 06 0A 41 BA A7 81 06 ...!.......A.... D5 57 4B 63 83 06 D5 57 48 9B AD 92 7E .WKc...WH...~ fsm_sdata(IPCP): Sent code 1,4,22. IPCP: sending Configure-Request, id 4 pppInput[0]: packet processed rx dump (38/1504): 7E 80 21 01 05 00 04 DA FA 7E 7E 80 21 02 04 00 ~.!......~~.!... 16 03 06 0A 41 BA A7 81 06 D5 57 4B 63 83 06 D5 ....A.....WKc... 57 48 9B 3B F1 7E WH.;.~ pppInProc[0]: got 38 bytes pppInput[0]: IPCP len=4 fsm_input(IPCP):1,5,4 fsm_rconfreq(IPCP): Rcvd id 5 state=6 (LS_REQSENT) ipcp_reqci: returning Configure-ACK pppWrite[0]: len=12 tx dump (12/12): 7E FF 03 80 21 02 05 00 04 AC F1 7E ~...!......~ fsm_sdata(IPCP): Sent code 2,5,4. pppInput[0]: packet processed pppInput[0]: IPCP len=22 fsm_input(IPCP):2,4,22 fsm_rconfack(IPCP): Rcvd id 4 state=8 (LS_ACKSENT) np_up: 0 proto=21 np_up: maxconnect=0 idle_time_limit=0 ipcp: up sifup: unit 0: linkStatusCB=0x800de59 errCode=0 ip_addr = 10.65.186.167 netmask = 255.255.255.0 dns1 = 213.87.75.99 dns2 = 213.87.72.155 local IP address 10.65.186.167 remote IP address 0.0.0.0 primary DNS address 213.87.75.99 secondary DNS address 213.87.72.155 pppInput[0]: packet processed lwIP PPP connected tcp_bind: bind to port 49153 tcp_connect to port 80 pppifOutput[0]: proto=0x21 tx dump (48/48): 21 45 00 00 2C 00 00 00 00 FF 06 00 00 0A 41 BA !E..,.........A. A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 00 ...#....P...m... 00 60 02 0B 68 00 00 00 00 02 04 05 B4 6B BE 7E .`..h........k.~ rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 01 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 85 F4 ..`..h.......... 7E ~ rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 02 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 B7 2B ..`..h.........+ 7E ~ tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 03 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 59 61 ..`..h........Ya 7E ~ rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 04 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 C2 9D ..`..h.......... 7E ~ tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 05 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 2C D7 ..`..h........,. 7E ~ rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb pppifOutput[0]: proto=0x21 tx dump (49/49): 7E 21 45 00 00 2C 00 06 00 00 FF 06 00 00 0A 41 ~!E..,.........A BA A7 AD C2 23 C3 C0 01 00 50 00 00 19 6D 00 00 ....#....P...m.. 00 00 60 02 0B 68 00 00 00 00 02 04 05 B4 1E 08 ..`..h.......... 7E ~ tcp_slowtmr: polling application rx dump (0/1504):
rx dump (0/1504):
rx dump (0/1504):
tcp_slowtmr: processing active pcb tcp_slowtmr: max SYN retries reached tcp_pcb_purge tcp_pcb_purge: data left on ->unacked could not connect to remote host pppClose() called pppClose: unit 0 kill_link -> pppStop pppStop: unit 0 link_down: 0 upap_lowerdown: 0 s=1 ipcp: down np_down: 0 proto=21 sifdown: unit 0: linkStatusCB=0x800de59 errCode=-5 lost connection IPCP: lowerdown state 9 (LS_OPENED) -> 1 (LS_STARTING) IPCP: close reason=LCP down state 1 (LS_STARTING) -> 0 (LS_INITIAL) pppLinkDown: unit 0 pppRecvWakeup: unit 0 ppp_send_config[0]: outACCM=FF FF FF FF ppp_recv_config[0]: inACCM=0 0 0rx dump (0/1504):
0 pppWrite[0]: len=29 tx dump (29/29): 7E FF 7D 23 C0 21 7D 25 7D 22 7D 20 7D 30 55 73 ~.}#.!}%}"}.}0Us 65 72 20 72 65 71 75 65 73 74 53 33 7E er.requestS3~ fsm_sdata(LCP): Sent code 5,2,16. LCP: close reason=User request state 9 (LS_OPENED) -> 4 (LS_CLOSING) pppRecvWakeup: unit 0 RECONNECT rx dump (0/1504):
rx dump (18/1504): 7E FF 7D 23 C0 21 7D 26 7D 22 7D 20 7D 24 94 7D ~.}#.!}&}"}.}$.} 2D 7E -~ pppInProc[0]: got 18 bytes pppInput[0]: LCP len=4 fsm_input(LCP):6,2,4 fsm_rtermack(LCP): state=4 (LS_CLOSING) link_terminated: 0 Connection terminated. pppLinkTerminated: unit 0 pppRecvWakeup: unit 0 pppLinkTerminated: unit 0: linkStatusCB=0x800de59 errCode=-5 pppLinkTerminated: finished. pppInput[0]: packet processed rx dump (0/1504):
tx dump (2/2): 41 54 AT rx dump (0/256):
tx dump (2/2): 0D 0A ..
вот код: CODE #include "inet.h" /*drivers*/ #include "main.h" #include "gate.h"
/*kernel*/ #include "FreeRTOS.h" #include "portmacro.h" #include "task.h" #include "queue.h" #include "semphr.h"
/*computer networking protocol suite*/ #include "lwip/mem.h" #include "lwip/memp.h" #include "lwip/inet.h" /*#include "ethernetif.h"*/ /*#include "netconf.h"*/ #include "lwip/tcpip.h" #include "ppp.h" #include "lwip/sio.h"
/*libc/libg libm libgcc*/ #include <stdio.h> #include <stdarg.h> #include <string.h> #include <ctype.h>
#define RX_BUF_SIZE 1540
static xQueueHandle xRxedChars;
void COM1_IRQHandler(void) { portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; if (USART_GetITStatus(COM1_USART, USART_IT_RXNE) == SET) { u8_t c = (USART_ReceiveData(COM1_USART) & ((1 << SERIAL_RS485_BITS) - 1)); xQueueSendFromISR(xRxedChars, &c, &xHigherPriorityTaskWoken); } portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); }
#define MODEM_TEXT_IO_LENGTH 256
#define SIO_SERIAL_PORT NULL #define PPP_CONNECTION_TIMEOUT 20000 / portTICK_RATE_MS #define MODEM_READ_TIMEOUT 200 / portTICK_RATE_MS
static int modem_putchar(int c) { while (USART_GetFlagStatus(COM1_USART, USART_FLAG_TXE) != SET) { continue; } USART_SendData(COM1_USART, c); return c; }
/*static int modem_printf(const char * fmt, ...) { static char tx_buf[MODEM_TEXT_IO_LENGTH]; int count; { va_list args; va_start(args, fmt); count = vsnprintf(tx_buf + 0, sizeof(tx_buf), fmt, args); va_end(args); } for (int i = 0; i < count; ++i) { if (modem_putchar(tx_buf[i]) < 0) { return i; } } return count; }*/
static int modem_getch(void) { u8_t c; if (xQueueReceive(xRxedChars, &c, 1 / portTICK_RATE_MS) == pdFALSE) { return -1; } return c; }
static int modem_exchange(char * AT_command) { static u8 rx_buf[MODEM_TEXT_IO_LENGTH]; int len; sio_write(SIO_SERIAL_PORT, (u8 *) AT_command, strlen(AT_command)); sio_read(SIO_SERIAL_PORT, rx_buf + 0, sizeof(rx_buf)); // discard echo if present sio_write(SIO_SERIAL_PORT, (u8 *) "\r\n", 2); len = sio_read(SIO_SERIAL_PORT, rx_buf + 0, sizeof(rx_buf)); if (len > 0) { int code; if (sscanf((char *) &rx_buf, "%i", &code) == 1) { vTaskDelay(100 / portTICK_RATE_MS); return code; } } return -1; }
static int connected;
static void linkStatusCB(void * ctx, int errCode, void * arg) { int * connected = (int *) ctx; struct ppp_addrs * addrs = arg; switch (errCode) { case PPPERR_NONE: { /* We are connected */ *connected = 1; printf("ip_addr = %s\r\n", inet_ntoa(addrs->our_ipaddr)); printf("netmask = %s\r\n", inet_ntoa(addrs->netmask)); printf("dns1 = %s\r\n", inet_ntoa(addrs->dns1)); printf("dns2 = %s\r\n", inet_ntoa(addrs->dns2)); break; } case PPPERR_CONNECT: { printf("lost connection\r\n"); /* just wait */ break; } default: { /* We have lost connection */ *connected = 0; break; } } }
static void hw_init(void) { USART_InitTypeDef USART_InitStructure; USART_InitStructure.USART_BaudRate = 57600; USART_InitStructure.USART_WordLength = USART_WordLength_8b; USART_InitStructure.USART_StopBits = USART_StopBits_1; USART_InitStructure.USART_Parity = USART_Parity_No; USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None; USART_InitStructure.USART_Mode = (USART_Mode_Rx | USART_Mode_Tx); com_init(COM1, &USART_InitStructure); USART_ITConfig(COM1_USART, USART_IT_RXNE, ENABLE); }
static void tcpip_init_done(void * arg) { if (arg != NULL) { *((int *) arg) = 1; } }
static void connection_task(void) { struct netconn * conn; struct netbuf * buf; struct ip_addr remote; err_t err;
IP4_ADDR(&remote, 173, 194, 35, 195);
conn = netconn_new(NETCONN_TCP); if (conn != NULL) { err = netconn_bind(conn, IP_ADDR_ANY, 0); // IP_ADDR_ANY if (ERR_OK == err) { err = netconn_connect(conn, &remote, 80); // IP_ADDR_BROADCAST if (ERR_OK == err) { printf("netconn_connect OK\r\n"); for (;;) { printf("tick\r\n"); vTaskDelay(1000 / portTICK_RATE_MS); char x[] = "test data\r\n"; /*if (x == EOF) { continue; } else if (c == '.') { printf("about to close connection\r\n"); err = netconn_disconnect(conn); LWIP_UNUSED_ARG(err); break; } else { printf("local echo: %s\r\n", x); }*/ buf = netbuf_new(); if (buf != NULL) { char * data = netbuf_alloc(buf, sizeof(x)); if (buf != NULL) { memcpy(data, x, sizeof(x)); if (netconn_send(conn, buf) != ERR_OK) { printf("cannot send the data\r\n"); } else { printf("data is sent\r\n"); } } else { printf("memory cannot be allocated\r\n"); } netbuf_delete(buf); } else { printf("lack of memory\r\n"); } } } else { printf("could not connect to remote host\r\n"); } netconn_disconnect(conn); } else { printf("could not bind to local interface\r\n"); } netconn_delete(conn); } }
#define PPP_AUTH_USERNAME "mts" #define PPP_AUTH_PASSWORD "mts"
static void inetTask(void * pvParameters) { (void) pvParameters; int setup = 0; int pd = -1; tcpip_init(tcpip_init_done, &setup); while (setup == 0) { vTaskDelay(100 / portTICK_RATE_MS); } pppInit(); hw_init(); for (;;) { vTaskDelay(1000 / portTICK_RATE_MS); modem_exchange("AT"); if (modem_exchange("AT Z0 E0 V0") != 0) { // OK continue; } if (modem_exchange("AT S0=0") != 0) { // OK continue; } if (modem_exchange("AT +CGDCONT=1,\"IP\",\"internet.mts.ru\"") != 0) { // OK continue; } if (modem_exchange("AT DT*99***1#") != 1) { // CONNECT continue; } pppSetAuth(PPPAUTHTYPE_ANY, PPP_AUTH_USERNAME, PPP_AUTH_PASSWORD); connected = 0; pd = pppOverSerialOpen(SIO_SERIAL_PORT, linkStatusCB, &connected); if (!(pd < 0)) { portTickType ticks = xTaskGetTickCount(); do { vTaskDelay(100 / portTICK_RATE_MS); if (connected != 0) { printf("lwIP PPP connected\r\n"); break; } } while (xTaskGetTickCount() < ticks + PPP_CONNECTION_TIMEOUT); if (connected != 0) { connection_task(); } pppClose(pd); } else { printf("could not connect\r\n"); } printf("RECONNECT\r\n"); } #if 0 for (;;) { vTaskDelay(100 / portTICK_RATE_MS); } #else vTaskDelete(NULL); #endif }
void inet_init(void) { xRxedChars = xQueueCreate(RX_BUF_SIZE, sizeof(u8_t)); xTaskCreate(inetTask, (signed char *) "inetTask", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, (xTaskHandle *) NULL); }
u32_t sys_jiffies(void) { return xTaskGetTickCount(); }
static __attribute__ ((noinline)) void print_dump(u8_t * data, u32_t len, const char * prefix) { int i, r, l, p; static u8_t line[0x10]; u8_t c; l = 0; for (i = 0; i < len; ++i) { c = *(data + i); r = (i % 0x10); if (isgraph© != 0) { *(line + r) = c; } else { *(line + r) = '.'; } if (i == 0) { p = printf("%s", prefix); } else if (r == 0) { printf("%*s", p, ""); } if (i + 1 == len) { printf("%02hhX %*.*s", c, r + 1 + (46 - l), r + 1, line + 0); l = 0; } else if (r == 0x0F) { printf("%02hhX %.16s\r\n", c, line + 0); l = 0; } else if (r == 7) { l += printf("%02hhX ", c); } else { l += printf("%02hhX ", c); } } }
static int read_abort = 0;
u32_t sio_read(sio_fd_t fd, u8_t * data, u32_t len) { LWIP_UNUSED_ARG(fd); int i; portTickType ticks = xTaskGetTickCount(); read_abort = 0; for (i = 0; i < len; ++i) { int c; do { c = modem_getch(); if (read_abort != 0) { break; } if (!(c < 0)) { data[i] = c; break; } } while (xTaskGetTickCount() < ticks + MODEM_READ_TIMEOUT); if (read_abort != 0) { read_abort = 0; break; } if (c < 0) { break; } } #if PPP_DEBUG == LWIP_DBG_ON printf("rx dump (%d/%d):\r\n", i, len); print_dump(data, i, ""); // "rcvd " ~pppdump format printf("\r\n"); #endif return i; }
void sio_read_abort(sio_fd_t fd) { LWIP_UNUSED_ARG(fd); read_abort = 1; }
u32_t sio_write(sio_fd_t fd, u8_t * data, u32_t len) { LWIP_UNUSED_ARG(fd); #if PPP_DEBUG == LWIP_DBG_ON printf("tx dump (%d/%d):\r\n", len, len); print_dump(data, len, ""); // "sent " printf("\r\n"); #endif for (u32_t i = 0; i < len; ++i) { modem_putchar(data[i]); } return len; }
похоже на syn (если он в правильном формате отправляется) нет ответа. я пробовал разные сайты, кроме того на собственном сервере с белым IP запускал nc -l 80, но нет ответа ни от кого. в чём может быть проблема?
Сообщение отредактировал eisufu - Jul 17 2012, 03:37
|
|
|
|
Сообщений в этой теме
eisufu STM32 lwIP PPPoS Jul 9 2012, 16:53 AlexandrY Такое ощущение, что не договорились про ACCM. Верн... Jul 10 2012, 09:26 kan35 Не похоже на мой лог. Попробую пальцем в небо:
У в... Jul 10 2012, 09:51 eisufu Цитата(kan35 @ Jul 10 2012, 15:51) Не пох... Jul 12 2012, 11:22 kan35 как я понимаю нужно оставить что то одно или CHAP ... Jul 12 2012, 13:13 eisufu RE: STM32 lwIP PPPoS Jul 13 2012, 05:23  kan35 Сделайте во первых
MD5_SUPPORT=0 PAP_SUPPORT=1 CHA... Jul 13 2012, 05:33 eisufu вот.
CODElcp_init: xmit_accm=0 0 0 0
upap_init: 0... Jul 13 2012, 06:02 kan35 опять в логе вижу слово CHAP - его быть не должно... Jul 13 2012, 06:24 eisufu RE: STM32 lwIP PPPoS Jul 13 2012, 10:02 eisufu спасибо за попытку помочь. Jul 13 2012, 17:15 kan35 Цитата(eisufu @ Jul 13 2012, 21:15) спаси... Jul 13 2012, 19:20 eisufu у меня на данный момент модем Huawei E173. проблем... Jul 16 2012, 10:10 kan35 Да, интернет на SIM карте надо было проверить в пе... Jul 17 2012, 04:09 eisufu убрал.
покопался в настройках lwIP. оказалось, что... Jul 17 2012, 05:53 eisufu уже удаётся. премного благодарен вам, kan35
остало... Jul 17 2012, 08:16
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0
|
|
|