Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:basic code for ESP server added #48

Merged
merged 1 commit into from
Aug 11, 2019
Merged

feat:basic code for ESP server added #48

merged 1 commit into from
Aug 11, 2019

Conversation

neel1998
Copy link
Member

@neel1998 neel1998 commented Aug 8, 2019

Fix #47

void setup(void) {
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
//Serial.println("");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean up the code

#include <ESP8266mDNS.h>

#ifndef STASSID
#define STASSID "ssid"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to define same thing multiple times. Set SSID in line 11 here and remove passwords.

}

void setup(void) {
WiFi.mode(WIFI_STA);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mode should be an access point. WIFI_AP

@neel1998
Copy link
Member Author

neel1998 commented Aug 9, 2019

@CloudyPadmal we cant remove password as far as i think. Because the Wifi.softAP() metho requires 2 arguments. Still I am getting the following error while uploading the sketch,

warning: espcomm_sync failed
An error occurred while uploading the sketch
error: espcomm_open failed
error: espcomm_upload_mem failed

I have esp-12s module,

and I am making following connections

(left side pins are esp pins and right side pins are arduino)
VCC -> 3.3V
GND -> GND
CH-PC -> 3.3V
Tx -> Tx
Rx -> Rx
GPIO0 -> GND
RST -> GND

@CloudyPadmal
Copy link
Collaborator

Password is optional. Look at the documentation https://arduino-esp8266.readthedocs.io/en/latest/esp8266wifi/soft-access-point-class.html#softap

#include <WiFiClient.h>
#include <ESP8266WebServer.h>

const char* ssid = "ssid";
Copy link
Collaborator

@CloudyPadmal CloudyPadmal Aug 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSID should be "PSLab_ESP"/"PSLab" or something

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes yes. This is just temporary. Will change .

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the change?

@neel1998
Copy link
Member Author

neel1998 commented Aug 9, 2019

warning: espcomm_sync failed
An error occurred while uploading the sketch
error: espcomm_open failed
error: espcomm_upload_mem failed

Have you programmed as ESP before?

Not before this project.

@neel1998
Copy link
Member Author

neel1998 commented Aug 9, 2019

@CloudyPadmal I haven't interacted with electronics too much before ... But I am willing to work on it.

@CloudyPadmal
Copy link
Collaborator

@neel1998 you've mentioned in your proposal that you'll have all the background studies covered prior to GSoC. Now it's almost end and I don't think this will have any outcome at all with this feature as you're studying about ESPs now. I dunno I'm not sure what to do. Can we finalize this PR right now? WiFi AP sample source codes are all over the internet and this shouldn't be a WIP for days.

@CloudyPadmal CloudyPadmal changed the base branch from master to pslab-esp-server August 9, 2019 13:34
@neel1998
Copy link
Member Author

neel1998 commented Aug 9, 2019

@CloudyPadmal I mentioned in my proposal that I will be providing android side support for esp communication. Still i am trying my best to work on firm ware as well. And for basic AP server code i think this should be fine. We can add other endpoints later.

@neel1998 neel1998 changed the title [WIP]feat:basic code for ESP server added feat:basic code for ESP server added Aug 9, 2019
@neel1998 neel1998 changed the title feat:basic code for ESP server added [WIP]feat:basic code for ESP server added Aug 9, 2019
#include <WiFiClient.h>
#include <ESP8266WebServer.h>

const char* ssid = "ssid";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where's the change?

@neel1998
Copy link
Member Author

neel1998 commented Aug 9, 2019

Yes I am not on my system right now. Will make the changes by night

@neel1998 neel1998 changed the title [WIP]feat:basic code for ESP server added feat:basic code for ESP server added Aug 9, 2019
@CloudyPadmal CloudyPadmal merged commit 856b30a into fossasia:pslab-esp-server Aug 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants