Hello,
the following code crash the board but it works fine with unix micropython. Where is the trouble ?
[code]
import ure
txtmsg = """client connected from ('192.168.0.44', 33714)
GET /?rouge=255&vert=255&bleu=255&time=15 HTTP/1.1
Host: 192.168.0.102
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: http://192.168.0.102/
Connection: keep-alive"""
print(txtmsg)
rouge = ure.search('rouge=(.+)&vert', txtmsg)
print('rouge type: ',type(rouge), rouge.group(1))
vert = ure.search('vert=(.+)&bleu', txtmsg)
print('vert type: ',type(vert), vert.group(1))
bleu = ure.search('bleu=(.+)&time', txtmsg)
print('bleu type: ',type(bleu), bleu.group(1))
time = ure.search('time=(.+)\ HTTP', txtmsg)
print('time type: ',type(time), time.group(1))
[/code]
The boar is a chinese nodeMCU :
[code]
>>> import port_diag
FlashROM:
Flash ID: 1640e0 (Vendor: e0 Device: 4016)
Flash bootloader data:
Byte @2: 00
Byte @3: 40 (Flash size: 4MB Flash freq: 40MHZ)
Firmware checksum:
size: 530228
md5: bc440e0ab9bf219b447b76721de745b3
True
[/code]
And micropython is
[code]
MicroPython v1.8.4-38-g34e0198-dirty on 2016-09-20; ESP module with ESP8266
[/code]
Regex, nodeMCU like : crash
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Regex, nodeMCU like : crash
I think you've found a bug in the ESP8266 implementation. Your code works on the Pyboard but crashes my reference Adafruit Feather Huzzah here. So I suggest you raise an issue on Github. If you are unsure how to do this I can do it for you.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Regex, nodeMCU like : crash
Same on WiPy.
MicroPython v1.8.4-42-g93c4a6a-dirty on 2016-09-21; WiPy with CC3200
MicroPython v1.8.4-42-g93c4a6a-dirty on 2016-09-21; WiPy with CC3200
Re: Regex, nodeMCU like : crash
Hello,
The issue is here :
https://github.com/micropython/micropython/issues/2451
Thanks for your help.
The issue is here :
https://github.com/micropython/micropython/issues/2451
Thanks for your help.