Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

esp8266 platform problem

Status
Not open for further replies.

yefj

Advanced Member level 5
Advanced Member level 5
Joined
Sep 12, 2019
Messages
1,505
Helped
1
Reputation
2
Reaction score
5
Trophy points
38
Activity points
9,113
Hello, i am trying to communicate with my esp8266.
I have tried to install the SDK on ECLIPSE ,i have installed GCC and made many setting on many manual and its just not working.
Is there a manual which explains step by step in windows 10 how to setup the need files so i could write firmware code on my device?
Thanks.

My product is as shown bellow.I prefer not to use arduino IDE because its too easy.

 
Last edited:

Hello,this is not my case, because if you follow my posts on the subject i implemented SPI and websocket separatly and i got stuck in combining them because the ESP webscketc blocked for some reason SPI commands
 

Is there a manual which explains step by step in windows 10 how to setup the need files so i could write firmware code on my device?

I followed the steps on this video, years ago, and worked fine:

ESP8266 IoT 2017, native C SDK Getting Started for Windows, Mac & Linux

i implemented SPI and websocket separatly and i got stuck in combining them because the ESP webscketc blocked for some reason SPI commands

There is no reason to not work, at first sight both SPI and WIFI libraries do not share hardware resources.
 

Hello Andre,Yes i saw this video i have built the follwoing code shown bellow on nodemcu v3 using thonny.
and what happen is the line before s.accept sent SPI signal but the SPI signal after the s.accept never came.
First i thought its waiting for me to connect to the socket so i connected the WIFI network and i entered https://192.168.4.1/ in the explorer and saw the Web socket text i set
What else can i do to connect to the socket?
Then i tried to add the nonblocking s.setblocking(0) line and still it just didt allow the SPI commands after s.accept.

I dont know why i get all my SOCKET text presented in the explorer but the SPI CODE only works before the SOCKET CODE .


Code:
from machine import Pin,SPI
import network
import usocket as socket
ap_if = network.WLAN(network.AP_IF)
ssid = 'sensor_net'
password = '123456789'
ap_if.active(True)
ap_if.config(essid=ssid, password=password)
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.bind(('',80))
s.listen(5)
spi=SPI(1, baudrate=1000000, polarity=0, phase=0)
while True:
    spi.write(b'1234')
    conn, addre=s.accept()
    request=conn.recv(1024)
    request='<p style="color:red"><u><h1>The temperature is:</u></p>'
    request2=str(12.7)
    response='gyhkjgku'
    conn.send('HTTP/1.1 200 OK\n')
    conn.send('Content-type: text/html\n')
    conn.send('Connection: close\n\n')
    conn.sendall(request)
    conn.sendall(request2)
    conn.close()
    spi.write(b'1234')
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top