Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
Add Multiple ports
Browse files Browse the repository at this point in the history
  • Loading branch information
ricaun committed Jul 1, 2021
1 parent 674bf07 commit fa622cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion DuinoCoin_Esp_Master/DuinoCoin_Clients.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#define SEP_TOKEN ','

const char * host = "51.15.127.80"; // Static server IP
const int port = 2814;
const int ports[] = {2813, 2814, 2816, 2812};

WiFiClient clients[CLIENTS];
byte clientsWaitJob[CLIENTS];
Expand All @@ -39,6 +39,10 @@ bool clients_connected(byte i)

bool clients_connect(byte i)
{
static int port = 0;
int port_size = sizeof(ports) / sizeof(ports[0]);
if (port >= port_size) port = 0;

if (clients[i].connected())
{
return true;
Expand Down
4 changes: 2 additions & 2 deletions DuinoCoin_Esp_Master/DuinoCoin_Esp_Master.ino
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const char* rigIdentifier = "ESP-I2C"; // Change this if you want a custom mine

#if ESP8266
#define LED_BUILTIN 2
#define MINER "AVR I2C v2.4.7"
#define MINER "AVR I2C v2.5.2"
#define JOB "AVR"
#endif

#if ESP32
#define MINER "AVR I2C v2.4.7"
#define MINER "AVR I2C v2.5.2"
#define JOB "AVR"
#endif

Expand Down

0 comments on commit fa622cf

Please sign in to comment.