BitMaker-hub / NerdMiner_v2

Improved version of first ESP32 NerdMiner
Other
1.38k stars 252 forks source link

[Feature] ESP32-S2FN4R2 (aka Lolin S2 mini) support #202

Closed julio-matarranz closed 3 months ago

julio-matarranz commented 9 months ago

Dear,

Could someone handle ESP32-S2FN4R2 please ?

It's a cheap and widespread ESP32-S2 module. It would be nice to have NerdMiner V2 on it. Thank you in advance.

elmo128 commented 9 months ago

Hi Julio, it is possible to build Nerdminer for boards, using the IC you specified (at least with basic settings). Unfortunateley, i don't own such a board and can't test it. I added the Lolin S2 mini board to my fork. If you want to test it, feel free to download and build the corresponding Branch, before i open a pull request. (If you need support for a specific display or other features, that are already implemented, we can talk about that too. Right now it is just basic support) https://github.com/elmo128/NerdMiner_v2/tree/lolinS2-Mini and requires Testing.

julio-matarranz commented 8 months ago

Hi @elmo128, Thank you for your work. I tried your version and I have those logs :

19:50:01.608 > SPIFS: Mounted
19:50:01.633 > SPIFS: No config file available!   
19:50:01.633 > *wm:[4] allocating params bytes: 20
19:50:01.634 > *wm:[3] Added Parameter: Poolurl   
19:50:01.635 > *wm:[3] Added Parameter: Poolport  
19:50:01.636 > *wm:[3] Added Parameter: btcAddress
19:50:01.637 > *wm:[3] Added Parameter: TimeZone  
19:50:01.638 > *wm:[3] Added Parameter:
19:50:01.638 > *wm:[4] Updated _max_params: 10    
19:50:01.639 > *wm:[4] re-allocating params bytes: 40 
19:50:01.640 > *wm:[3] Added Parameter: SaveStatsToNVS
19:50:01.641 > AllDone:
19:50:01.645 > Setup...
19:50:01.645 > *wm:[3] Starting Config Portal
19:50:01.645 > *wm:[3] AccessPoint set password is VALID
19:50:01.645 > *wm:[4] ap pass MineYourCoins
19:50:01.650 > *wm:[4] WiFi station disconnect
19:50:01.652 > *wm:[4] WiFi_enableSTA enable
19:50:01.655 > *wm:[3] Disabling STA 
19:50:01.656 > *wm:[3] Enabling AP
19:50:01.657 > *wm:[2] StartAP with SSID:  NerdMinerAP
19:50:02.367 > *wm:[2] SoftAP Configuration 
19:50:02.368 > *wm:[2] --------------------
19:50:02.369 > *wm:[2] ssid:             NerdMinerAP
19:50:02.370 > *wm:[2] password:         MineYourCoins
19:50:02.372 > *wm:[2] ssid_len:         11
19:50:02.372 > *wm:[2] channel:          1
19:50:02.374 > *wm:[2] authmode:         3
19:50:02.374 > *wm:[2] ssid_hidden:
19:50:02.375 > *wm:[2] max_connection:   4
��50:02.376 > *wm:[2] country:          CN 
19:50:02.377 > *wm:[2] beacon_interval:  100(ms)
19:50:02.378 > *wm:[2] --------------------
19:50:02.878 > *wm:[2] AP IP address: 192.168.4.1
19:50:02.880 > *wm:[3] [CB] _apcallback calling
19:50:02.881 > Entered Configuration Mode
19:50:02.881 > Config SSID: NerdMinerAP
19:50:02.882 > Config IP Address: 192.168.4.1
19:50:02.883 > *wm:[4] setupConfigPortal
19:50:02.884 > *wm:[2] Starting Web Portal
19:50:02.887 > *wm:[3] HTTP server started
19:50:02.888 > *wm:[3] WiFi Scan ASYNC started
19:50:02.893 > *wm:[4] setupDNSD
19:50:02.895 > *wm:[4] dns server started with ip:  192.168.4.1
19:50:02.897 > *wm:[3] Config Portal Running, blocking, waiting for clients...
19:50:13.476 > *wm:[3] NUM CLIENTS:  0
19:50:43.472 > *wm:[3] NUM CLIENTS:  0

But I don't see the AP and there is nothing happening after.

elmo128 commented 8 months ago

Hi @julio-matarranz, thanks for testing. Unfortunateley I can't reproduce the issues on the platform available to me.

I applied some minor changes to the config file (ie. update of wifiManager library). Additionally i recommend you to erase the flash memory of your esp32 manually before uploading the firmware, to get rid of config data already stored to the device. Please also make sure, that no other Wifi access point named "NerdMinerAP" is in range. The logs you submitted seem to be very similar to what can be found among the issues, people had with the wifi manager library before: eg. https://github.com/tzapu/WiFiManager/issues/1478 some even claim, that there are faulty boards out there.

If this does not help, feel free to try the new branch https://github.com/elmo128/NerdMiner_v2/tree/lolinS2-Mini-PoC-Set2nv. It does not make use of SPIFFS to store settings anymore (Proof of concept implementation). But because the embedded flash of your board is internally hooked up to an SPI port, i don't really expect it to fix anything. Keep in mind, that esp32 only supports 2.4Ghz.

This branch: https://github.com/elmo128/NerdMiner_v2/tree/lolinS2-Mini-HCSPISD is prepared to either use hardcoded values or to hook up an SD card for configuration. Please follow the instructions in the readme, on how to prepare the later. Both options should circumvent the creation of a configuration AP altogether in a simialar way and configure everything, if there are no settings saved. You can find the pin assignement for a SD card in the file platform.io. Alternativeley you can also hardcode your credentials there. Both methods are implemented in pretty much the same way.

The S2 is a single core Device. Please expect a much lower hash rate, even if we get it to work.

julio-matarranz commented 8 months ago

Dear, Thank you for your help but I think my S2 mini can go to trash. After many tries the wifi seem to be broken on that cheap clone. Thank you again and sorry for your time

elmo128 commented 8 months ago

Hello@ julio-matarranz, You're welcome. Thanks for your contribution. There are a lot of applications for esp32 based devices, some of which don't even require wifi....

julio-matarranz commented 8 months ago

@elmo128 I was kidding about throwing it away, I will try to fix it one day if there is a good fix but for now it sound pretty experimental with adding a random capacitor. I bought some ESP32-S3 from Lilygo, they aren't cheap but I know why Lolin S2 mini clones are cheap... 🤣

Your first code for ESP32S2 should be enough if my hardware weren't faulty.

I don't know what capacitor I should buy on AliExpress to fix the WiFi but I would do that soon ish and let you know. ☺️

Thank you again

elmo128 commented 8 months ago

Hi @julio-matarranz, :joy:

I don't know what capacitor I should buy on AliExpress

tzapu/WiFiManager#1478

They link to the espressif forum, where possible hardware issues and fixes are discussed: https://esp32.com/viewtopic.php?f=19&t=28506 Other sources can be the documentation (datasheets, manuals, appnotes, etc.) provided by the manufacturer for the IC or eval boards. I probably don't have to write this, but i recommend you to try some other programs of your choice (especially wifi demos/examples) to confirm, that your board is indeed faulty, before messing around.

JohnTaipei commented 8 months ago

@elmo128 Hello Sir: Could you create .BIN files for S2 mini board?? Thanks

elmo128 commented 8 months ago

@JohnTaipei, hello Sir, thanks for your interest. Although i have never uploaded binaries before and am not 100% sure about which files are required, i added some binaries to each branch starting with lolinS2-Mini, in my personal dev fork. Please read the discussion above, to find out more about issues. I can't give you any guarantees, not even that i uploaded all files that are required or that the addresses contained in most file names are right. Thus i recommend you to install vcstudio and platformio, if you run into errors, to make sure that everything has been uploaded in the right way. Have a lot of success!

JohnTaipei commented 8 months ago

@elmo128 Thank you so much Sir :D I will try it and hope it works

JohnTaipei commented 7 months ago

@elmo128 Hello Sir: I tried your BIN files work OK but only 32KH/s

Could you upgrade BIN files to V1.6.3 Thanks

ben-barnard commented 6 months ago

Any update on this? Would love to use mine.