- Apple Watch
- iPhone topik
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Merész dizájn és új teleobjektív az iPhone 17 Pro mobilokban
- Megérkezett a Google Pixel 7 és 7 Pro
- Okos (AI) szemüveget mutatott be a Meta
- Google Pixel topik
- Samsung Galaxy S25 - végre van kicsi!
- Xiaomi 15 Ultra - kamera, telefon
- Samsung Galaxy S23 Ultra - non plus ultra
-
Mobilarena
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
Janos250
őstag
válasz
Wolfram #19320 üzenetére
Nincs ez elbonyolítva.
Hirtelenjében ezt hoztam össze.
Ha erre gondoltál használd, ha nem, majd valakinek valamire hátha jó lesz.#define __cplusplus 201103L
#include <WiFi.h>
#include <WiFiClient.h>
#include <string>
#include <iostream>
#include <fstream> // ofstream
#include <stdio.h>
using namespace std;
#define remoteServerPort 80
//const char* ssid = "*********";
//const char* password = "*********";
uint8_t ServerIPlocal[] {192,168,0,30} ;
uint8_t gatewayIPlocal[] {192,168,0,1} ;
uint8_t subnetIPlocal[] {255,255,255,0} ;
WiFiServer remoteServer (remoteServerPort );
WiFiClient remoteServerClient ;
void setup() {
delay(1000);
Serial.begin(115200) ;
delay(1000);
WiFi.begin(ssid, password );
delay(2000);
WiFi.config(ServerIPlocal, gatewayIPlocal, subnetIPlocal) ;
WiFi.setAutoReconnect(true);
delay(2000);
printf("\nConnecting to %s \n",ssid);
uint8_t i = 0;
while (WiFi.status() != WL_CONNECTED && i++ < 20){
printf(".");
delay(500);
}
if(i == 21){
printf("\nCould not connect to \n",ssid);
while(1) delay(500);
} ;
string strMyURL = "http://"+
to_string(WiFi.localIP()[0])+"."+
to_string(WiFi.localIP()[1])+"."+
to_string(WiFi.localIP()[2])+"."+
to_string(WiFi.localIP()[3])+":"+
to_string(remoteServerPort)
;
printf("My URL: %s \n",strMyURL.c_str() );
uint8_t ip[]{192,168,0,33};
String valasz = httpGet((IPAddress)ip) ;
Serial.println(); Serial.println(); Serial.println(); Serial.println();
Serial.println("ez a valasz:");
Serial.println(valasz);
} // end setup
void loop() {
} ; // end loop
String httpGet(IPAddress ip){
const char GET_HTTP[] PROGMEM = R"=====(
GET / HTTP/1.1
)=====";
uint16_t idozites ;
String reply ;
WiFiClient remoteServerClient ;
if (!remoteServerClient.connect(ip,80)){
return "no connect";
Serial.println ("connect hiba");
} ;
// Serial.println ("connected");
remoteServerClient.println(GET_HTTP);
idozites = 0 ;
reply = "" ;
while (
remoteServerClient.available() ||
(idozites++ < 500)
) // rxBuffer->available()
{
if (remoteServerClient.available()){
char c=remoteServerClient.read();
idozites = 0 ;
reply += c ;
// printf("%c",c);
}
else{
delay(1);
}; // if (remoteServerClient.available())
} ; // end while (remoteServerClient.available())
// printf("\n");
remoteServerClient.stop(); // _rxBuffer = NULL; _connected = false;
// Serial.println();Serial.println();Serial.println();Serial.println();
// Serial.println("Ez a string");
// Serial.println(reply);
return reply ;
};
Új hozzászólás Aktív témák
- ZBook Fury 16 G10 16" FHD+ IPS i7-13850HX RTX 3500 Ada 32GB 1TB NVMe ujjlolv IR kam gar
- 2x Kingston FURY Impact 2x32GB DDR4 3200MHz KF432S20IB/32 összesen 64GB notiram
- Dell 27" 2K P2723D 27" IPS panel 2560x1440 QHD Pivot HDMI
- Intel I5 13600 k (1 év Garanciával )
- Asztali PC , i7 6700 , RTX 2060 , 32GB DDR4 , 240GB SSD , 500GB HDD
- GYÖNYÖRŰ iPhone 12 Pro 256GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3438, 94% Akkumulátor
- ÁRGARANCIA!Épített KomPhone i5 14400F 16/32/64GB RAM RX 9060 XT 16GB GAMER PC termékbeszámítással
- iKing.Hu - Samsung Galaxy S25 Edge Prémium dizájn, AI-élmény a zsebedben 12/512 GB
- Új akksi! Microsoft Surface Pro 6 i5-8350U 8GB 256GB 100%sRGB 1 év garancia + billentyűzet opciók!
- GYÖNYÖRŰ iPhone 12 mini 128GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3277, 100% Akkumulátor
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest