串行通信ttyUSB

时间:2016-04-15 12:44:36

标签: php modem tty serial-communication

我正在使用https://github.com/rubberneck/php-serial/blob/master/php_serial.class.php从/ dev / ttyUSB0读取数据,但在尝试通过AT + CMGL = 4命令登记所有短信时,它会读取3到4个短信并通过 ERROR 消息,但如果我这样做但在通过minicom初始化该端口之前它完全正常并列出所有数据。我在哪里犯错误?缓冲区大小是这里的问题还是什么?

我在ubuntu 14. *或更高版本之后面对这个问题还有一件事,在12.04它刚刚正常工作。

在通过minicom初始化端口之前。

AT + CPMS = MT

+ CPMS:55,55,55,55,55,55

AT + CMGL = 4

+ CMGL:1,1,145 0891683108501345F12404A17100000860116011104200825C0A8D358D854EBA75286237FF1A56DE005A0053004395015B9A4E2A4EBA8D266237FF0C00515E016D888D395373523B77ED4FE1544A77E5FF018FD853EF83B78D60005100515BA07269FF0C770B597D53CB96908EAB4E0A7EBF7B495F3A5927529F80FDFF0C003100305143002F6708FF0C514D8D398BD57528003700325C0F65F6

+ CMGL:2,1,149 0891683108501345F12004A1710000086011601110420086514D8D398D3458EB4E4B63ED80F67EB8300180F65E2659996CD5FF1A751F786C53BB63ED8D34572858994E0A768480F67EB8FF0C4F1A635F574F72694EF6FF0C752884B86C7D71A8659771A84E004E0BFF0C5C31661363ED53BB4E86300256DE003900300039003283B7514D8D3977ED4FE10033003000306761002C003100305143002F6708

+ CMGL:3,1 ,, 151 0891683108501345F12404A1710000086011601110420088514D8D3965F65C1A987E95EEFF1A76AE80A49ED176844EBA5B9C7A7F669682728C0376845F319971548C827288637740FF0C4EA653EF7A7F7EAF9ED188637740FF0C4EE57EFF30017EA2548C7D2B7F57517082724F5C4E3A886551458272300256DE003900300039003283B7514D8D3977ED4FE10033003000306761002C003100305143002F6708

+ CMGL:4,1 ,, 83 0891683108501345F12407A1710043F1000860116041225000426E38620F79D84E66FF1A5FAE8F6F79F07D225C3C0050005357287EBF6E38620F7F5159318D2500200030003700350035002D00380033003700360035003500360036

ERROR

通过minicom初始化端口后,同样的程序可以正常工作并登记所有数据。

AT + CPMS = MT + CPMS:55,55,55,55,55,55

AT + CMGL = 4 + CMGL:1,1,145 0891683108501345F12404A17100000860116011104200825C0A8D358D854EBA75286237FF1A56DE005A0053004395015B9A4E2A4EBA8D266237FF0C00515E016D888D395373523B77ED4FE1544A77E5FF018FD853EF83B78D60005100515BA07269FF0C770B597D53CB96908EAB4E0A7EBF7B495F3A5927529F80FDFF0C003100305143002F6708FF0C514D8D398BD57528003700325C0F65F6 + CMGL:2,1,149 0891683108501345F12004A1710000086011601110420086514D8D398D3458EB4E4B63ED80F67EB8300180F65E2659996CD5FF1A751F786C53BB63ED8D34572858994E0A768480F67EB8FF0C4F1A635F574F72694EF6FF0C752884B86C7D71A8659771A84E004E0BFF0C5C31661363ED53BB4E86300256DE003900300039003283B7514D8D3977ED4FE10033003000306761002C003100305143002F6708 + CMGL:3,1 ,, 151 0891683108501345F12404A1710000086011601110420088514D8D3965F65C1A987E95EEFF1A76AE80A49ED176844EBA5B9C7A7F669682728C0376845F319971548C827288637740FF0C4EA653EF7A7F7EAF9ED188637740FF0C4EE57EFF30017EA2548C7D2B7F57517082724F5C4E3A886551458272300256DE003900300039003283B7514D8D3977ED4FE10033003000306761002C003100305143002F6708 + CMGL:4,1 ,, 83 0891683108501345F12407A1710043F1000860116041225000426E38620F79D84E66FF1A5FAE8F6F79F07D225C3C0050005357287EBF6E38620F7F5159318D2500200030003700350035002D00380033003700360035003500360036 + CMGL:5,1 ,, 132 0891683108501345F12406A1710034000860117001347300745C0A8D358D854EBA75286237FF1A56DE65705B5760A85C06514D8D3983B75F97FF1A00318D854EBA79D87C4DFF1B0032988653D694BB77F3FF1B00338A008BED4F2060C5FF1B003494C397F38D855E02FF1B00356027611F7F8E56FEFF1B00368D8570AB5F695B57FF1B00375151595657305E26 + CMGL:6,1 ,, 147 0891683108501345F12004A1710000086011700134730084514D8D395A3195FBFF1A00320030003000365341592750129709660E661F51FA7089FF0C964851EF6B4C7B2C4E00FF0C7D27968F5176540E670990ED5FB77EB23001005400770069006E00733001674E4E9A9E4F300180E16B4C300256DE0038003100350031770B534159278131661F8D707EA27ECF5386002C003100355143002F6708 + CMGL:7,1 ,, 149 0891683108501345F12404A1710000086011700134830086514D8D394E508BAFFF1A8D3973896E055C064E8E0031003267080031003665E553574EAC4E3E529E300A00300036300C8109810958F060C5300D4E2A5531300BFF0C5C4A65F68FD85C065C5573B06A214EFF59298D4B300262E8003100320035003900300038003800310038003000338F7B677E83B700515E01002C00315143002F5206949F + CMGL:8,1 ,, 137 0891683108501345F12404A171000008601180016521007A5C0A8D358D854EBA75286237FF1A53D190016D88606F52300031003700300030002B60A8597D53CB624B673A53F77801FF0C53EF5C064FE1606F53D862107EDA4E3D591A5F69768452A8611F5F695B57FF017ED9597D53CB4E004E2A60CA559C5427FF0156DE590D0044004365594F6073A98F6C8D854EBAFF01 + CMGL:9,1 ,, 143 0891683108501345F12004A171000008601180016531008052A06CB97AD9514D8D3963D0793AFF1A4F1A54585B9865B97F517AD965397248556600218BBE7F6E7CBE5F69529F80FD002C7BA174064E2A4EBA4FE1606F002C53C24E0E670065B06D3B52A8002C4EAB53D76210957F72796743002C4E007AD9641E5B9A002E7F515740007600690070002E00710071002E0063006F006D3002 + CMGL:10,1 ,, 141 0891683108501345F12404A171000008601180016531007E7EA294BB63D0793AFF1A0051005179C07EA294BB4F1A5458002C5C0A73B04F6076848D3565CF8EAB4EFD00215F155BFC65F65C1A6F6E6D410021767B9646003A0068007400740070003A002F002F0071007100730068006F0077002E00710071002E0063006F006D8FD86709514D8D39529F80FD516865B04F539A8C0021 + CMGL:11,1,95 0891683108501345F12407A1710043F10008601180414284004E6E38620F79D84E66FF1A69825FF56E38620F004D0050003400206ED176D68BBE8BA19A7080FD004700356B635F0F516C5E0300200030003700350035002D00380033003700360035003500360036 + CMGL:12,1 ,, 153 0891683108501345F12404A171000008601190010222008A6E2999A863D0793AFF1A5C0A8D3576847EA294BB75286237FF0C60A853EF4EE5968F5FC362406B325730628A60A876840051005179C0593450CF8BBE7F6E4E3A60A8768400510051593450CFFF018BE20034003000300038003800310032003300340035300256DE590D004800510052FF0C005100516C384E0D4E225931002C003100305143002F6708 + CMGL:13,1 ,, 141 0891683108501345F12004A171000008601190010222007E514D8D394E50575B516B5366FF1A546867704F26572863A553D791C78BBF65F68868793AFF0C5E26774059885988770B300A6EE157CE5C3D5E269EC491D17532300B662F56E04E3A59885988559C6B2254686DA653D1300256DE590D00390030003800314E0B8F7D795E79D863D0795E94C358F0002C00355143002F6708 + CMGL:14,1,145 0891683108501345F12404A17100000860119001022200825C0A8D358D854EBA75286237FF1A60F38981514D8D3965E0965091CF4E0B8F7D6027611F7F8E56FEFF0C56DE590D00440043537353EF83B753D6FF018FD8670965E06570641E602A52A8753B4EFB4F604E0B4E2A8FC7763E300157 + CMGL:29,1 ,, 131 0791190948505115A40C911928378583600000411180913104227FC1728BF89ED3590D45F01C96839661313A0DA2BEDF74D0322C0709D36B343A2C0729C3E13788FA46839A7535BA0CCA86C364D0322C6797DD615743E16A28A2EBB4CB056A96E56510341C9E836AD23A3C9C2F83AE61761A642C5A93ADE835395C8284E575382C0741C3E43408194E8300 + CMGL:30,1 ,, 147 0791190948505115A40C9119283785836000004111412212942292DAB49B7C4E83E661B8FB0D9A97416E741A840EC7D3F1301D342F83D4E97C18B40ECBDFAC65BEBE4E83E661B8FB0D6A9741F3B4DC0C82A3EB6CD01A9D668741EBB09C5E06A1C36937EBFA06C1D17536280C5FBF41EB7C18A44FBBC9E734885C769FCB2CE51BB446D7C92019889C7683D4E97C18B496D3CB207438ED7681CE2E37 + CMGL:31,1 ,, 151 0791190948505115E40C9119283785836000084111412232222284050003A702020069006E002000770069007400682026002E005300412026002E005200452026002E004700412026002E000A0042005500542026002E003F000A0046005200490045004E0044005300480049005000200062006500670069006E0073002000770069007400682026002E2019000A20180059006F00750026004D0065201D + CMGL:32,1 ,, 159 0791190948505115C40C91192837858360000041011222106522A005000327020188E5321CA40CB3E965903A7C6E87CF617A19240FA3CB2C1052412C97E12065984D2F83D4E1733B7C0ED3CB2079185D668190F536281C86AFDFA060180E4287DB65503E1C2683C2617A19240FA3CB2C85322C06D1C36B903EED2687CF69103A9C6681C8F530081D4E83D0E176589E069D82613868880EBBC9A0751A440FCBC36890367C6E87CF + CMGL:33,1 ,, 140 0791190948505115A40C911928378583600000411140819384228ACE3068DA9CB29C61101CFD769741CE30089E1ED3EBF232CB1906D1DFEE320BB4CE8741E2B01B740EE7CB20F41B447C3A7F2077BD2D2ECB41F437289C9E9741EC743E0CA2A3C32C75383D2F83E46F3D681D96BFCF651014F9741659A0B018B42EA3E96510FACD028190C12628085D1641C860D2095A229FCE1F + CMGL:34,1 ,, 37 0791190948505115E40C9119283785836000004101122210952214050003270202C2F432481E46975D2ED7D90D + CMGL:35,1,,48 0791190923500520240C9119477120934200004101703130212221CD70DA0D42A7DB61771A84AE83D6F930085D0F83C6ECF07C0E6A87D36E + CMGL:36,1 ,, 159 0791190948505115C40C91192837858360000041013171556422A0050003220301A67538FC3D2F8B406BF91BD42E83E4613A68FD06C940E2B0BA0C0AC3D7A0333A2C07AD416374988E06AD41F334399D7F83E0655018BE06CDC37434485CA6A3D320741DF49683CA747719D42E83C2F035E88C0ECB41EB30088E7EBB4162353D0C4297416F39281C8683E0E8B71B14A697DD64D05AEE2E83D4617A19847E83EE61787A0E0ABBCB + CMGL:37,1 ,, 159 0791190948505115C40C91192837858360000041013171551522A005000322030240EB30E81E2687416B39BD0C42BF416A31281C8683E0E8B7BB0C82A7C76BD05A4E2F83D06F10FD0DBABF4170B40BD42CCBCBA0333A2C07CDCB20F49B1E06A1CBA0B71C1486AFDF2078981E068DD161363D0C429741EB34A85D96A741ED371D0DA281CEE8B09B5E06C1CB687619847E83CEF934282C0685C370D03D0C0FCF41E1F0FB5C06D1DF + CMGL:38,1 ,, 159 0791190948505115A40C911928378583600000412181123302229FD930192476AFE52074BB3C478741E130BD0C92A3CBEE7399A550E4EB20741A748FD341E2F23D1CA783E861323C4C2F83E4E8B2FB5C662914E47A18B496BF41EB34688C7ED3D320F41B546F87E520743B2C4F83EE61B93B0CD2A7DDE4731A244687E5A0307CFD06E5EB20741A340FD3C3F432488E2EBBCF65970B0402814020100804028140C73A1DE4CED301 + CMGL:39,1 ,, 156 0791190948505115A40C911928378583600000411190121204229CDAB0BC2E4F839CE83468095296CBEE326819062DDF69D0348C0ECBC30AE49BA595D7E56990139D062D41CAF47C5D0621DB20E45B717D83846910B21D968741C8376B591FA341CBF01C4D4FE7C36E05F1FD1683906990329C0F8396727A1A846469E575791AE444A741CBB20229072DC373343D0D5A9641CEF0BC5C16839A65D032ED0ECBC320E4DB05 + CMGL:40,1 ,, 33 0791190948505115E40C9119283785836000004111809131412210050003C502025AD05D2BA56B1101 + CMGL:41,1 ,, 51 0791190948505115E40C911928378583600000410131715555222405000322030340EB7C1DF49683DCE83488FE06ADF37590BC0C67E741ED320804 + CMGL:42,1 ,, 152 0791190948505115A40C911928378583600000411180911175229720629A0D42A741E4341BD40EA7417537BA0C82E7C36139681D96D3CB207438ED520CD175F8181D0EC341ED3AFA2D0ED341EB3028AD4687E5A075584E2F83D02E45B60C5287DDEBB01CB44E83EE6FD03A3D6F97E9A036C81D46A741EDB2BCEC5240C37250DD8D2E83E0617719B44E83D6EF797A0E1287C37290381C9683D66139BD0C42BB00 + CMGL:43,4,41 0791190948505115240C911958432823320000410180414091221941B73ACC4E83E8657919D49E9F416679198406ADF361 + CMGL:44,4,159 0791190948505115A40C91192837858360000041119012129522A0C6B0BC2C0651D16150D5BD4E8390E1791AD42C838273743A9E064DC36D355A210CA7E96556335CA783966F10B20D0AC2DD699036ED2687CF69C534DC0EAB41C2709A5E6665CB68D0351CA78396615033AC0FAF15547418940D8390E176589E0609C36477789E16A74155F73A0D22BE15C230FDED66ADDFA0E61BFD168BC374D0B4AD468384E134BDEC728542 + CMGL:45,1 ,, 103 07911989015081710410D04162EB1ACC4E9B530000411171326072225DB81AAD06BBC16AB6984E812EE75D2E974BD15280A465383B0FB2A7C3A06B382F9B36A7A0A7D99C1EA7C36C50D04D96BFD36450100E778188EFBB9BFD0E937520349D0ED7BD5EE234DDC5CEBFAEB269100A05 + CMGL:46,1 ,, 159 0791190948505115C40C91192837858360000041010170240122A0050003A5020144C47A182402B5D3EC324804BA86C96F11685E662914A279988E068940ED34BB0C1281C270F75B049A97590A85685D9FA3D3F93048046AA7D9659008A40E9F45F3324BA110C9C3E876980E1281DA6976192402C9C362D1BCCC02291422783E2C078940ED34BB0C1281E661B108342FB3148A7C189D068940E47A182402A1C3699008240F8B45 + CMGL:47,1 ,, 65 0791190948505115E40C9119283785836000004101017024312234050003A5020240F332689D662914E130ACED76F1031CC4E83A06590338C4EB31441B8BB0C8286DD6BF41B049583ACE939FA1E9E83906F7A18845488A66F50987D0FE7E720BABC3EA783F2EFBA7C5E669B458A739D0C72A7CFE8341D + CMGL:52,1 ,, 33 0791198973909959240C91199885241076000051404002737522104B74D81D06ADD161901C9D06A1EB + CMGL:53,1 ,, 158 0791198901508171440A8148154022760008412121002024228C050003E203010041006E006A0061006C006900420020002800380037003500350036003100370033003000300029003A00200057006900730068002000750020006100200076006500720079002D002000320020002A002A002A002A002A00480061007000700079002000420069007200740068006400610079002A002A002A002A0041004E004A0041004C + CMGL:54,1 ,, 149 0791190948505115A40C9119283785836000004101521222702294CC705B9C06A1C3695033ECD6A7D920E2FB2D07A1C369D032ED0ECBC3AC75BE0E7287D16950384C0F83C26250737E06D1EBEDB03CCC0209D1EF371B740EE7CB206738DC06E5C32067BD2D2ECB41C8703B2C0F8342A06C18D44EB341E7703E0C5ABFD320E27B4E0721C3ED79192446A741D07C581E76B95C2E97EBFC7E935DEE748E0E + CMGL:55,1 ,, 158 0791198901508192240C911907063340060000411170816262229EC1B01AB40689C9A0765D8D9E9741EBB0189D06D941623AA84D07ADE5EEB0CBE5728DD161799D0D729341F330BBEE72B95C69103A4C2F83EA20F19B8E76B95CE13019B446D7C9A0B59C5E06A1DFA0B71CE40EB741EDB23C0C6287CF617A19847EBB5CF0303ACC2E83ECA079985D07B941EDBA1A5D0689DFEC30888E0E83DE72507A2E9683E87577D9E50201

0 个答案:

没有答案