![]() |
Forum Index : Microcontroller and PC projects : Is there a way
Page 1 of 2 ![]() ![]() |
|||||
Author | Message | ||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
To read the .UF2 file for a Pico? THIS is the SeedStudio MicroPython UF2 file It has support with wireless drivers, network, usocket, MQTT, supported out of the box My thinking is If it's possible to read the file, then it can be seen how it communicates with the ESP8285 on board wifi module on their version of the Pico ie which uart it's using or how the RP2020 and ESP8285 communicate with each other It might make it possible to use the wifi on that board with Picomite if we can see how it communicates and what commands it accepts? It might even be possble (Peter?) to include the drivers for the ESP8285 in the PicoMite UF2 so wifi can be easily used like it used to be when the Pi version was working? Especially as "most" of the RP2040 boards that have Wifi onboard seem to use the ESP8285 the Arduino nano being different as it uses a NINA-W10 wifi module Edited 2022-01-16 22:01 by lew247 |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
What does "Is there a way To read the .UF2 file for a Pico?" mean? To me it's a file so of course yes there is... John |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
From the context I think Lewis possibly means disassemble / reverse engineer so that parts of its functionality can be added into MMBasic. Is it not open-source? Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Of course, reading it and understanding what's in it are two entirely different things. :) If you are *really, astonishingly* lucky it's going to be an ASCII hex file. If you aren't quite so lucky it'll be a raw binary file with a header stuck on it. If you are having a bad hair day it'll be a binary and have an unknown sort of compression applied to it. So, basically, no. Not unless disassembling RP2040 binaries is your thing. This might help if you are feeling masochistic. Edited 2022-01-17 04:59 by Mixtel90 Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
hitsware2![]() Guru ![]() Joined: 03/08/2019 Location: United StatesPosts: 719 |
I have tried looking @ circuit Python code and relating it to Basic Without much luck (but I'm sorta challenged) my site |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
"how it communicates with the ESP8285" Read data sheet(s)? Easier than disassembly etc, I expect. John |
||||
georgestheking Newbie ![]() Joined: 21/12/2021 Location: BelgiumPosts: 32 |
Hi, A WIFI librairy using the ESP8266 will be very interesting. There is already in the firmware a lot of AT command for communication and MQTT. I think especially of MQTT, the best way for IOT and communication for wireless devices. By the way, the Cytron board has a free place for an ESP8266. Best regards Georges Edited 2022-01-17 06:41 by georgestheking |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
I have said repeatedly that I will consider including specific ESP8266 AT support in MMBasic but someone needs to come up with some proposals for commands/functions required and MMbasic compatible syntax - each time I issue this challenge there is a deafening silence. Personally, I don't find any issue with using standard existing commands to execute AT commands to control and access the ESP8266 and have posted a number of examples of this going back to the MM2 |
||||
flasherror Senior Member ![]() Joined: 07/01/2019 Location: United StatesPosts: 159 |
I want to help but need to become familiar (again) with 8266 AT firmware, having not used it in a while. The last time I used it was before commands to support MQTT etc were implemented. From memory, dealing with AT command firmware can be more complex than it first appears. For example, module may return BUSY response to an issued command instead of the expected response. Also, events like wifi connection dropping, wifi reconnect or DHCP timeout may occur at any time. The way I dealt with this was have timer interrupt code: 1. process RX from ESP8266 and pass RX data to main (with flag change to indicate "RX data ready") 2. handle sending (main code would pass what it wanted to send and timer interrupt code would handle sending, including waiting for wifi/dhcp reconnect if connection dropped). 3. automatically send some device data (such as device node #, wifi signal strength etc) before resending the data passed from main 4. ISR would notify main that data was sent sucessfully via flag This was for TCP/IP send, not UDP (which is unreliable i.e. "best effort but delivery not guaranteed"). Internally the ISR had a state machine implemented to detect responses from ESP8266 "WIFI DISCONNECT" etc and set flags, which were checked to change state (i.e. in the event of wifi disconnection change from "connected" to "wait for wifi connect" then "wait for DHCP IP assigned" etc) Also, there was a timeout mechanism to detect if we timed out waiting for response from ESP8266 and resend last command if needed (this was because when you send most commands you expected a certain # of CRLF terminated lines back, and if things got out of sync or something unexpected happened you might get less lines back (i.e. waiting forever if no timeout mechanism). I think I got distracted by other things and left the code at this point but it was able to recover from most real life events. I realise this isn't exactly a proposal but just some thoughts. Edited 2022-01-17 10:28 by flasherror |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
As Peter indicated, he has addressed some of the issues with the AT commands, e.g., MM2: webserver with AT mode ESP8266. I've used that base code a number of times. The best integration of the ESP8266 (and ESP32) with basic that I know of is in Annex Basic--a decidedly non-trivial effort (and also non-trivial even to derive a specification for a web-friendly MMBasic from Annex). I don't think anyone has even published an AT command MMBasic example for MQTT. That might be the next step. PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Nice idea but I did actually do that before I asked the question The Esp8285 has 1MB of ram built in, and as it's integral to the actual Pico board and the drivers are built into the Pico's uf2 file I have no way of knowing how the Pico communicates with the ESP8285 I don't know if it#s using SPI or one of the com ports to talk to it, or some other means I dont know if the ESP8285 uses the AT command set on the board or if it's programmed with something else Thats why I said how do you read the uf2 file because it will have all the information on how to do the avove built into it and yes by read I meant disasseble or however you read these files, I useless at this as most of you know, I just have ideas but no idea how to implement them. And it's an ESP8285 NOT the esp8286 that's built into most RP2040 boards that have wifi |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
If it helps anyone this is how a valid uf2 file can be generated I believe But I haven't found a way to reverse it yet This is the Pico SDK and it recommeds using Raspberry Pi Pico C/C++ SDK Edited 2022-01-18 03:38 by lew247 |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
Lets be clear. There is precisely no way to usefully get information out of a uf2 file that could help in any sensible timescale. You would probably be talking months of work. Unless their source is open it is a complete non-starter |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Thanks Peter I did wonder because this is what their documentation says |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Does this make sense to anyone? Latest firmware for Wio RP2040 but it would need someone who actually understands to confirm or not *it uses the AT command set* This is their WIKI on MQTT I still have ONE of these boards with built in WIFI available if anyone IN THE UK wants to play with it and get it working on Picomite? Edited 2022-01-18 04:17 by lew247 |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hi Lewis, If no-one else comes forward in the next few days and you want to lend your spare board to me then I'm prepared to take a look as time permits (but I won't be disassembling any .uf2 files). In addition it will be competing with the other projects on my bench at the moment, so this offer might prove to be a pig in a poke. Best wishes, Tom MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
The esp8285 data sheet says the 8266 docs & tools are "Must-Read" & "Must-Have". Also, I see: "between ESP8285 and ESP32, there is also an intermediate solution ESP8285. This is a great option if your project does not have enough memory or computing resources, but at the same time, ESP32 is redundant. The ESP8285 module is a continuation of the ESP8266 line and has a higher degree of integration and reduced dimensions. With the same functionality, the ESP8285 chip has a 1MB program memory operating in DUOT mode." John Edited 2022-01-18 07:41 by JohnS |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I've asked SeedStudio direct how to communicate with the ESP8285 ie which uart GPIO it uses In the Meantime I know it can communicate via SPI I've got that working Can anyone tell me if this is correct? SETPIN GPIO11, GPIO8, GPIO12, SPI2 'Miso GPIO8, MOSI GPIO11, CLK GPIO10 Then if that is correct can anyone tell me how to send and receive the AT commands? for instance if I wanted to send AT+CWL which should return a list of all available AP's Can this be sent by SPI the same as you would using Uart? and can it be read? or can this only be done with uart Sorry for the stupid questions but I'm "trying" to learn |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Personally, I don't find any issue with using standard existing commands to execute AT commands to control and access the ESP8266 and have posted a number of examples of this going back to the MM2 The ability to display a list of AP's and be able to connect with the AP would be essential I would imagine I don't know how you could use the WGET feature using AT commands but I guess if it's possible Peter would know how to implement it system "wget -q -O- "+q$+"api.openweathermap.org/data/2.5/weather?id=2651357&units=metric&appid=0e661c0eb78b1f4b28419346ab6159db"+q$,b() longstring PRINT b() OPEN1() 'GOTO SUB OPEN1 system "wget -q -O- "+q$+"api.openweathermap.org/data/2.5/forecast/daily?id=2651357&units=metric&appid=0e661c0eb78b1f4b28419346ab6159db"+q$,c() longstring PRINT c() OPEN2() 'GOTO SUB OPEN2 I for one would like to be able to ask for the ability to send and receive by Wifi such as using Wget, others I'm sure would have more knowledge of what is actually needed ESP8285 implements TCP/IP and full 802.11 b/g/n WLAN MAC protocol. It supports Basic Service Set (BSS) STA and SoftAP operations under the Distributed Control Function (DCF) From what I've been able to uncover this is the list of AT commands it accepts (not tested) Basic AT Commands Command Description AT Test AT startup AT+RST Restart module AT+GMR View version info AT+GSLP Enter deep-sleep mode ATE Enable/Disable AT commands echo AT+RESTORE Factory Reset AT+UART UART configuration(Deprecated) AT+UART_CUR UART current configuration (Won't save to Flash) AT+UART_DEF UART default configuration (Save to Flash) AT+SLEEP Sleep mode AT+RFPOWER Set RF TX Power AT+RFVDD Set RF TX Power according to VDD33 WiFi AT Commands Command Description AT+CWMODE WIFI mode (Deprecated) AT+CWMODE_CUR Current WIFI mode (Won't save to Flash) AT+CWMODE_DEF Default WIFI mode (Save to Flash) AT+CWJAP Connect to AP (Deprecated) AT+CWJAP_CUR Current Connect to AP (Won't save to Flash) AT+CWJAP_DEF Default Connect to AP (Save to Flash) AT+CWLAP Lists available APs AT+CWQAP Disconnect from AP AT+CWSAP Configure softAP (Deprecated) AT+CWSAP_CUR Configure current softAP (Won't save to Flash) AT+CWSAP_DEF Configure default softAP (Save to Flash) AT+CWLIF List stations connected to softAP AT+CWDHCP Enable/Disable DHCP (Deprecated) AT+CWDHCP_CUR Current Enable/Disable DHCP (Won't save to Flash) AT+CWDHCP_DEF Default Enable/Disable DHCP (Save to Flash) AT+CWAUTOCONN Connect to AP automatically when power on AT+CIPSTAMAC Set station mac address (Deprecated) AT+CIPSTAMAC_CUR Set station mac address (Won't save to Flash) AT+CIPSTAMAC_DEF Set station mac address (Save to Flash) AT+CIPAPMAC Set softAP mac address (Deprecated) AT+CIPAPMAC_CUR Set softAP mac address (Won't save to Flash) AT+CIPAPMAC_DEF Set softAP mac address (Save to Flash) AT+CIPSTA Set station IP address (Deprecated) AT+CIPSTA_CUR Set station IP address (Won't save to Flash) AT+CIPSTA_DEF Set station IP address (Save to Flash) AT+CIPAP Set softAP IP address (Deprecated) AT+CIPAP_CUR Set softAP IP address (Won't save to Flash) AT+CIPAP_DEF Set softAP IP address (Save to Flash) AT+CWSTARTSMART Start SmartConfig AT+CWSTOPSMART Stop SmartConfig TCP/IP AT Commands Command Description AT+CIPSTATUS Get connection status AT+CIPSTART Establish TCP connection or register UDP port AT+CIPSEND Send data AT+CIPSENDEX Send data, if or "\0" is met, data will be sent AT+CIPSENDBUF Write data into TCP-send-buffer AT+CIPBUFRESET Reset segment ID count AT+CIPBUFSTATUS Check status of TCP-send-buffer AT+CIPCHECKSEQ Check if a specific segment is sent or not AT+CIPCLOSE Close TCP/UDP connection AT+CIFSR Get local IP address AT+CIPMUX Set multiple connections mode AT+CIPSERVER Configure as server AT+CIPMODE Set transmission mode AT+SAVETRANSLINK Save transparent transmission link to Flash AT+CIPSTO Set timeout when ESP8266 runs as TCP server AT+CIUPDATE Upgrade firmware through network AT+PING Ping an IP address or hostname |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4044 |
I would try each of: 1(i) use Arduino to make stuff work (looks like via SPI) (ii) tweak code to MMBasic syntax 2(i) get 8285 into UART mode (ii) use Peter's code for 8266 Both should work, with time & effort. It strikes me that if there are poor or no Arduino examples the maker will hardly sell devices! Plus, it will be very hard to use MMBasic. John Edited 2022-01-18 23:42 by JohnS |
||||
Page 1 of 2 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |