|
Forum Index : Microcontroller and PC projects : CMM2: ESP-01 with esp-link firmware: 43KBps xmit; 20K xmit+save
| Author | Message | ||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3477 |
I installed esp-link v3.0.14 on an ESP-01 following this video . I set a fixed IP for my network, and in the uC console window, reset the baud rate to 460800 (the maximum). I modified the program I posted previously in the "Failed FTP" thread to use that baud rate, created a new 1MB file to send, and used this PLINK.EXE command (from puTTY folder) to send the file (after starting the CMM2 program): "\Program Files\putty\plink" 192.168.2.24 -telnet < \dl2\ftp\tst3.txt The program ran, reporting this: Trying to get tst.txt Receiving tst.txt * Bytes, checksum: 1163710,106396450 1163710 Characters; 57.722555 seconds; 26.999234 seconds transmitting; checksum: 106396450 20160 bytes per second total; 43101 bytes per second (to transmit) So here's another way to wirelessly send a file to the CMM2--provided it's less than 5MB (since the esp-link software doesn't support flow control with either XON/XOFF or CTS (as far as I can tell). Option explicit Dim string xon=Chr$(17),xoff=Chr$(19),ack=Chr$(6),nak=Chr$(21),a$,b$,c$,d$,fn$ Dim integer i%,j%,k%,l%,m%,n%,cksum%,oldloc%,baud%,nChar%,pCTS%=37 dim float t!,ttx!,tmr! 'baud%=1843200 ' 115200 230400 460800 1843200 'baud%=115200 ' 230400 460800 1843200 baud%=460800 ' for esp-link 1843200 'Open "com1:"+Str$(baud)+",2000000" As #1 Open "com1:"+Str$(baud)+",5200000" As #1 fn$="tst.txt" print "Trying to get "+fn$ open "\"+fn$ for output as #2 print #1,fn$+xon; pin(pCTS%)=1 ' clear to send oldloc%=0 cksum%=0 nChar%=0 timer=0 do while loc(#1) = 0 and timer < 10000: loop ' wait 10 seconds for transmission if loc(#1) = 0 then print "File Not Received: "+fn$+"--exiting" print #1,chr$(7); ' tried ^C,^D,ESC,"quit"+chr$(13)+chr$(10); ' EOT pause 1000 end else print "Receiving "+fn$ endif timer=0 t!=0 ttx!=0 tmr!=timer do l%=loc(#1) if l%=0 then ' transmission done if cksum%>0 then ' something received print #1,str$(nChar%)+","+str$(cksum%)+xoff pin(pCTS%)=0 ' not clear to send print " Bytes, checksum: "+str$(nChar%)+","+str$(cksum%)+xoff exit do else pause 2000 ' allow more time for start-up if loc(#1) = 0 then ' nothing received print "File Not Received--exiting" ' exit do print #1,xon; pin(pCTS%)=1 ' clear to send endif endif elseif l%>5100000 or oldloc%=l% then ' this block is done; xoff and write to SD card print #1,xoff; pin(pCTS%)=0 ' not clear to send ttx!=ttx!+(timer-tmr!): print "*"; do while loc(#1) > 0 ' clear all characters from buffer b$=input$(255,#1) j%=Len(b$) For i%=1 To j% c$=Mid$(b$,i%,1) cksum%=cksum%+Asc(c$) nChar%=nChar%+1 Next i% print #2,b$; loop print #1,xon; pin(pCTS%)=1 ' clear to send tmr!=timer endif oldloc%=l% pause 1000 ' wait a second loop t!=timer print #1,chr$(7); ' tried ^C,^D,ESC,"quit"+chr$(13)+chr$(10); ' EOT pause 200 on error skip 1 close #1 on error skip 1 close #2 print nChar%;" Characters; ";t!/1000;" seconds; ";ttx!/1000;" seconds transmitting; checksum: ";cksum% print int(nChar%/(t!/1000));" bytes per second total; ";int(nChar%/(ttx!/1000));" bytes per second (to transmit)" PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
| Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 596 |
Sounds cool , thanks Plasma |
||||
| Plasmamac Guru Joined: 31/01/2019 Location: GermanyPosts: 596 |
@lizby how do you powered the esp modules ? Plasma |
||||
| lizby Guru Joined: 17/05/2016 Location: United StatesPosts: 3477 |
I used 3V3 directly off the CMM2 40-pin connector, with dupont wires running to an ESP-01 breakout module. I soldered 10K between 3V3 and CHPD, and a 1800uF 6.3V cap between 3V3 and 0V. ![]() A smaller cap would probably work, and perhaps none (there's a tiny cap on the breakout board). PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |