ChatGPT with Arduin...
 
Notifications
Clear all

ChatGPT with Arduino and ESP32 | C++ and MicroPython coding

37 Posts
7 Users
4 Likes
2,516 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6865
 

@jjs357 Have you tried the 'do it again' button? It will generate a different result, or tell it to create 2 files, boot.py and main.py.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
jjs357
(@jjs357)
Member
Joined: 1 year ago
Posts: 30
 

@zander Yes I tried to regenerate and it never produced the two files option. Has this worked for you?

I did get several different kinds of answers but none that made it clear what to do.


   
ReplyQuote
jjs357
(@jjs357)
Member
Joined: 1 year ago
Posts: 30
 

@byron It does run, but not in the way that Bill shows in his video. That mentions a SSID with a ChatGPT name on it so I was expecting to see such a SSID in my available networks. I don't see this. And the URL with IP 192.168.4.1 does not answer.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6865
 

@jjs357 No, I don't use python. @byron is your best guy to ask for python stuff

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
byron
(@byron)
No Title
Joined: 5 years ago
Posts: 1121
 

@jjs357

The default ip address of the esp32 in Access Point mode is 192.168.4.1.  The SSID is whatever you code it to be (or what chatGPT deemed it to be).  It also possible to use the esp32 in Station mode where it gets its ip address from your router DCHP server.  

I dont know what code has been presented, but I see from @zander 's comment its likely to be different each time.  Have a go at asking the chat to amend your code to give you a SSID of your choice.  Chat - revise my code to give me a SSID name of 'FRED', and then sing me a song called 'right said Fred'.  (all together now - right said fred, ....... ,  so we had a cup of tea, and)

If you want some good reading on real code to set up AP or Station modes on an ESP32 have a look at the following link.

https://linuxhint.com/esp32-access-point-micropython-thonny-ide/


   
Ron reacted
ReplyQuote
jjs357
(@jjs357)
Member
Joined: 1 year ago
Posts: 30
 

@byron Now that you mention Access Point mode, I think that might be the source of my problem. All of the alternatives ChatGPT has provided so far were using Station mode. I wonder if I can phrase my code request to say that I want the "answer" to use Access Point mode. I will give that a try.


   
ReplyQuote
jjs357
(@jjs357)
Member
Joined: 1 year ago
Posts: 30
 

I am pleased to report success after I gave the following modification request to ChatGPT

change station mode to access point mode in the previous code

This then modified the code that did not work (using Station mode) and added some lines for setting up AP mode

# Set up access point
ap_if = network.WLAN(network.AP_IF)
ap_if.active(True)
ap_if.config(essid='ESP32-AP', password='password')

The wireless network ESP32-AP then was selectable and using the URL:

 http://192.168.4.1 

I see the ChatGPT Header displayed.

Screen Shot 2023 03 09 at 5.25.07 PM

This means I got to the end of Bill's tutorial (excellent I might add) and duplicated his results. I used an ESP32 all of the way through though, rather than an Uno for the first part.


   
ReplyQuote
Page 3 / 3