Giter VIP home page Giter VIP logo

Comments (10)

joaquinbvw avatar joaquinbvw commented on July 18, 2024 1

In case someone want the code I'm running here it is. It seems to be working great without any bad shares or close to zero for long runs. I have added WiFiMulti reconnection too. Btw, I have changed the baudrate too, it's 500K, the ESP32 can handle that speed nicely.

DuinoCoinESP32.txt

from duino-coin.

revoxhere avatar revoxhere commented on July 18, 2024

Really nicely explained! We will try to make use of these tips, @JoyBed should also take a look

from duino-coin.

joaquinbvw avatar joaquinbvw commented on July 18, 2024

Great! I hope it helps.

By the way there is a couple of things that I forgot, one is the flushing of the client, this should be done before sending any request to the server and after the reading of the buffer. Doing it like this would help preventing the mixing of messages (for example the server version could be merged with the actual job causing a bad share).

Yesterday I was making some tests and find out that there were a lot of bad shares, I was thinking that maybe it was the esp_sha function but playing with the yield and some delays I found out that somehow the esp_sha need some wait time before and after execution, I don't know why it behaves like that but when I put some delays before and after suddenly there were not one bad share. And it didn't affect the hashrate, the delays I use are 10 microseconds before and after each esp_sha call.

Finally another suggestion is to stop using the delay functions, I think the RTOS handles that well on the background, but this is just for the ESP32, it's a little bit messy to use the delay function on a task. This is somewhat of an opinion more than a fact actually haha.

Will be looking forward to any change in the future.

from duino-coin.

xscode avatar xscode commented on July 18, 2024

Tried your new code and it dies after several minutes every time, not sure why as I'm not saving the serial output.

from duino-coin.

joaquinbvw avatar joaquinbvw commented on July 18, 2024

I will post it without WiFiMulti, I think is making the code crash.

from duino-coin.

joaquinbvw avatar joaquinbvw commented on July 18, 2024

Try this one. I didn't remove the WiFiMulti (it is quite useful) I have change some lines and I think it works but let me know if you have some problems.

By the way, the server will always close the connection from time to time (could be several minutes or some hours), I think this behavior is expected and after that it should connect immediately. What it should not be expected is to disconnect from WiFi or don't connect to WiFi at all.

DuinoCoinESP32.txt

from duino-coin.

vicko03 avatar vicko03 commented on July 18, 2024

is not working

from duino-coin.

vicko03 avatar vicko03 commented on July 18, 2024

@joaquinbvw ....is not working.

from duino-coin.

joaquinbvw avatar joaquinbvw commented on July 18, 2024

@joaquinbvw ....is not working.

Ok, what do you see on the serial monitor? Is it connecting to WiFi or not connected at all? I think that code I posted had some issues with some boards and also I don't like it very much that's why I didn't put a request. Nevertheless I have requested a code change now, maybe you can try that code instead. Here it is:

https://github.com/revoxhere/duino-coin/blob/9fbee1b3612976c3dd8e3005d82ca2203874c3c6/ESP32_Code/ESP32_Code.ino

from duino-coin.

joaquinbvw avatar joaquinbvw commented on July 18, 2024

I believe I have implemented all of these optimizations already on the latest version. Will close it now.

from duino-coin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.