Comments (8)
Hi,
Currently Smart.js has a Websocket client. However it's not hard to implement a websocket server.
It's not clear to me what to do you want exactly. Your code snippet is a html + javascript snippet.
I assume you want to host that HTML on a device running Smart.js, open it on a browser and have your JS code on the user's browser communicate with some code (C or JS?) running on the embedded device. Is that correct?
from mongoose-os.
@mmikulicic Yes, this would be great!
from mongoose-os.
For example;
I have server and it has a capability of websocket communication. I want to use my esp8266 as a client and i should able to program with javascript language. This is my basic idea.
I ask that; i can use my browser as a websocket client (i dont know this term is correct or not) to connect my server. When i connect my server (http:// myserver. com:8080/websocket/default.html) my browser interpret javascript code in source code of default.html . I am asking; a esp8266 flashed with smartjs, can i use it same javascript code for connection to my server as a client
My general idea's picture is blow.
so maybe my approach is completely wrong way i dont know but i search, any guidance would be wellcome.
from mongoose-os.
yes, what you want is a WebSocket client running on your ESP device with Smart.js.
Smart.js does that. You can run JavaScript code on your ESP device. It's practically the same code you'd run on your browser, except the HTML part.
Things like <script type="text/javascript">
are HTML and do not make sense in this context.
They would make sense only if we were talking about files stored on the ESP device and make it act as a HTTP server; but in that case this is not the JavaScript code that would be running on the device.
Does it make sense?
@pastukhov would you mind creating a new issue for tracking your feature request that seems to me unrelated to this ticket ?
from mongoose-os.
Smart.js does that. You can run JavaScript code on your ESP device. It's practically the same code you'd run on your browser, except the HTML part.
This sentence is what i want to hear. thanks
from mongoose-os.
you need to build the firmware with ./make.sh RTOS
to enable the WebSocket API.
This SDK is currently less stable than the default (OSS).
from mongoose-os.
@mmikulicic
Can we close this issue? Does <script type="text/javascript">
work in current FW?
from mongoose-os.
We currently do support Websocket client API, in both C and JS
We support only Websocket server API in C.
The <script type="text/javascript">
is part of the HTML page that is served by the server (www.myserver.com in the picture), so it has nothing to do with our FW.
Closing
from mongoose-os.
Related Issues (20)
- ESP-IDF update for ESP-32 to protect against Braktooth HOT 1
- Self re-trigger crashes with stack canary or double exception (ESP32) HOT 2
- Camera connect
- ESP32 reboots continuously after flashing new build.
- Possible race issues? HOT 1
- Running out of RAM during OTA update HOT 2
- Failed to flash ESP32-S2 HOT 1
- Resource leaks HOT 2
- Potential resource leaks HOT 2
- Adding api_timer.js gave core dump HOT 7
- Power Management in ESP32 HOT 4
- ESP32 SNTP sys.tz_spec weird result HOT 6
- Undefined reference to `ping_start'
- Support for ESP32-S3
- Google Cloud IoT Core will no longer be a service on August 16th, 2023 HOT 1
- esp32-c3 build fails with `unknown CMake command "add_prebuilt_library"` HOT 5
- mos fails to launch - Windows 10 HOT 2
- Mongoose OS using mongoose 6.18 with bugs in it
- ESP32 MQTT Broker Over WS HOT 3
- Certificate of build.mongoose-os.com expired HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongoose-os.