Jump to content
ELFORUM - Forumul electronistilor

Modificare sketch pentru Acces Point


Untold
 Share

Recommended Posts

Va salut. 

Am bagat intr-un Nodemcu un sketch cu care pot comanda din reteaua de net diverse electrice. Stiu insa ca Nodemcu isi poate face propriul wifi, sau acces point/AP. Am scris si sketchuri cu AP in node si as vrea ca acest sketch ce ma intereseaza sa faca AP, nu cum se conecteaza la reteaua wifi locala prin scrierea SSID si Pass. Am incercat eu sa inlocuiesc cele cateva linii de cod, insa mi-a dat mai multe erori la compilare, ca nu stiu programare.

Ma poate ajuta cineva sa-mi modifice acele linii sa fac AP? Multumesc!

Mai jos sketchul fara AP, cu reteaua locala.

 

 

Sketch.odt

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

@Untold
Inlocuiesti
 

// Connect to Wi-Fi
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
    Serial.println("Connecting to WiFi..");
  }


cu:
 

 // Setting AP
 WiFi.mode(WIFI_AP);
 WiFi.softAP("Untold","x1x2x3x4");


Si apoi vei gasi o retea Wifi cu SSID: Untold si pass "x1 ..."
Si te vei putea conecta cu un browser la adresa IP a AP-ului.

 

Edited by antemir
Link to comment
Share on other sites

Posted (edited)

Multumesc frumos, o sa incerc azi!

 

L.E. Am inlocuit si aici cu:

 // Replace with your network credentials
const char* ssid = "Untold";
const char* password = "x1 x2 x3 x4";

 

La serial monitor imi zice ca IP is unset, desi AP exista si nu mi-a dat nicio eroare la compilare. Sau trebuie sa sterg asta: 

 // Replace with your network credentials
const char* ssid = "Untold";
const char* password = "x1 x2 x3 x4"; ?

 

 

 

Untitled.jpg

Edited by Untold
Link to comment
Share on other sites

Posted (edited)

Intr-adevar, am sters chestia asta: // Replace with your network credentials
const char* ssid = "Untold";
const char* password = "x1 x2 x3 x4"; si merge, IP-il este cel pt esp8266 de obicei, adica 192.168.4.1

 

Multumesc inca o data, mi-ati fost de mare ajutor!!

 

 

Untitled.jpg

 

Si asa arata pagina web:

 

 

Untitled.jpg

Edited by Untold
Link to comment
Share on other sites

Posted (edited)

Atasez aici sketchul functional cu  web server si acces point si 4 relee. 

Se poate modifica usor numarul de relee aici, pentru cine nu stie:

 

// Set number of relays
#define NUM_RELAYS  4

// Assign each GPIO to a relay
int relayGPIOs[NUM_RELAYS] = {5, 4, 14, 12};

 

Eu am testat si cu 8 si functioneaza, dar asta este in functie de cati gpio are esp-ul.

 

Scuze daca am spus ceva gresit, dar eu sunt ajutor de incepator in Arduino.

 

Numai bine!

Nodemcu AP 4 relays.docx

Edited by Untold
Link to comment
Share on other sites

cu 74138 nu poate comanda decat un singur releu din 8.

pentru "inmultirea" porturilor eu folosesc circuite serial IN/parallel output + latch si eventual + driver.

pentru iesiri simple: 74HC595 sau HCF4094B

pentru iesiri cu drivere: MIC5821/MIC5822, MIC5841/MIC5842. UCN5811/UCN5812

pentru intrari I2C: MAX7310/MAX7311/MAX7312, PCA9534/PCA9554 sau binecunoscutul PCF8574.

si mai sunt multe altele... 

cel mai bun pentru comanda releelor este MIC5842. Nu este nevoie decat de relee si circuit fara nici o alta piesa.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share




×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.Terms of Use si Guidelines