nodemcu

含CH340/CH341的模块在虚拟机中的使用

旧巷老猫 提交于 2019-12-09 10:05:43
很多电子模块都使用了CH340/CH341的USB转串口芯片,如Arduino和NodeMCU。 我的主机用的MacOSX,虚拟机用的VirtualBox上的Ubuntu15.10。 原来MacOSX上不能使用,参照 http://my.oschina.net/u/2306127/blog/614944 ,然后搞定了。 但在Ubuntu虚拟机中挂载USB设备时,虽然显示列表上有,但操作时总是报错。后来,在VirtualBox的管理界面中,把设备预先加载上去,还是不行。 将设备拔出,虚拟机重启 后,在MacOSX中找不到设备了! 再到虚拟机中去挂载,然后就OK了 。 这种方式不能在宿主机和虚拟机快速切换,像有的设备(如移动硬盘)可以即时挂载和卸载,但毕竟两个系统中都能使了。 来源: oschina 链接: https://my.oschina.net/u/2306127/blog/615974

采用CH340/CH341芯片的模块使用

吃可爱长大的小学妹 提交于 2019-12-09 10:05:31
由于驱动问题,CH340/CH341的NodeMCU在Mac OS X和虚拟机上的Ubuntu使用会有些问题。 不过,都可以解决了。参照如下的办法: 使用CH340/341的模块在Mac上驱动安装 http://my.oschina.net/u/2306127/blog/614944 含CH340/CH341的模块在虚拟机中的使用 http://my.oschina.net/u/2306127/blog/615974 来源: oschina 链接: https://my.oschina.net/u/2306127/blog/615976

使用CH340/341的模块在Mac上驱动安装

陌路散爱 提交于 2019-12-07 13:55:48
CH340/341的USB转串口模块在很多Arduino以及NodeMCU的板子上使用,但是其在Mac上往往出现找不到端口的现象,尤其在最新版本的Mac OS X上,主要是由于驱动没有签名引起。可以通过下面的方式搞定,就可以正常使用了: 第一种方法(简单,没试过): 新买的Arduino开发板,USB转串口使用了CH340芯片,在Mac OS X Yosemite上正常安装驱动后,在Arduino IDE的端口没发现相应的设备,使用以下方法后就能使用USB转串口调试和烧录程序。 1、安装CH340驱动(驱动下载地址: http://www.wch.cn/download/CH341SER_MAC_ZIP.html ) 2、打开终端运行以下命令: sudo nvram boot-args="kext-dev-mode=1" sudo Reboot 第二种方法(麻烦一些,测试通过): 1、按住电源键重启,立即按住CMD+R进入Recovery模式。 2、在菜单上选择,打开 Terminal 控制台。 3、运行命令: csrutil enable --without kext 4、输入:reboot 5、系统重启后,访问 http://www.wch.cn/download/CH341SER_MAC_ZIP.html 下载驱动、安装即可。 在Ubuntu虚拟机中使用设备端口 http:/

Sntp.sync() ignores server

大憨熊 提交于 2019-12-04 06:06:32
问题 I've been trying to synchronize time with ntp servers, however, nodemcu seems to ignore the server parameter. -- sync.lua sntp.sync("fr.pool.ntp.org", function() tm = rtctime.epoch2cal(rtctime.get()) print(string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])) end) Execution.. > dofile('sync.lua') > 2017/05/22 21:38:39 The time response is the unix epoch time (https://www.epochconverter.com/). Is it supposed to be the server

OpenSCAD设计的3D打印NodeMCU外壳

寵の児 提交于 2019-12-03 08:47:54
NodeMCU是集成了WiFI和MCU的小巧开发板,基于ESP8266芯片。论坛在 http://bbs.nodemcu.com/ ,源码在 https://github.com/nodemcu 。 使用 OpenSCAD 给它做了一个外壳,可以用3D打印机输出出来,就再也不用“裸奔”了。 OpenSCAD的原始模型文件如下,可以自行修改后在3D打印机上输出。 //NodeMCU智能设备,盒子,防雨淋型(垂直安装) //Author:openthings@163.com, //copyright 2015-2025. //打印时注意比例变化,并且旋转向上。 //避免上部打印时无支撑塌陷。 //盖子单独打印,或放为两个模型。 //常量定义 athick=0.5; //盖子厚度 bthick=0.10; //盒壁厚度 bwidth=4.0; //内径净宽 bhight=1.5; //内径净高 blong_inter=5.5;//内径净长 //外径长度=底厚+内径+挡格+盖子厚度 blong=bthick+blong_inter+bthick+athick; //文字或图标标识 //translate([-2,0,0]) //scale([1, 1, 0.1]) // surface(file = "smiley.png", center = true); //=============

NodeMCU的smartConfig功能代码实现手机app配置模块连接网络(更新ssid和password)

匿名 (未验证) 提交于 2019-12-03 00:30:01
一、功能背景介绍 NodeMCU用的芯片是esp8266所以对于芯片的功能在其官网有详细说明。 以下地址为官网对于SmartConfig的介绍文档 https://www.espressif.com/sites/default/files/documentation/esp-touch_user_guide_cn.pdf 这里是我们是在NodeMCU下开发,对上述文档的api函数做了自己的封装。因此我们实现功能的时候 只要参考NodeMCU的开源代码即可,官方文档也有提及:地址如下: 其开源代码 https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h 其官方文档对SmartConfig的介绍 https://arduino-esp8266.readthedocs.io/en/2.4.1/esp8266wifi/station-class.html#connect-different 二、示例代码 #include <ESP8266WiFi.h>; void setup() { Serial.begin(115200); delay(10); // 必须采用 AP 与 Station 兼容模式 WiFi.mode(WIFI_STA); delay(500); /

How to get post parameters from http request in lua sent to NodeMCU

旧巷老猫 提交于 2019-12-02 22:01:41
问题 I sent this HTTP POST request via Tasker (Android app) to my NodeMCU, which looks like this: POST / HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Tasker/4.9u4m (Android/6.0.1) Connection: close Content-Length: 10 Host: 192.168.0.22 Accept-Encoding: gzip <action>Play</action><SetVolume>5</SetVolume> I only want to extract what is between the "<action>" and "<SetVolume>" parameters. How can I do that? 回答1: For the sake of completeness, here is another solution I came up

The wifi.sta module connects if a loop is running?

人盡茶涼 提交于 2019-12-02 20:26:20
问题 Im trying to detect when the module actually connects to my wifi AP, since .connect does not have a callback im doing something simple like this: wifi.sta.config("SSID","password") wifi.sta.connect() tmr.delay(1000000) i = 0 while(wifi.sta.status() ~= 5 and i < 10) do print("Waiting") print(wifi.sta.status()) i = i + 1 tmr.delay(1000000) end But the output of .sta.status() is always 1 inside the loop. When it finish, if I send the command =wifi.sta.status() manually from the IDE it tells me 5

How to get post parameters from http request in lua sent to NodeMCU

馋奶兔 提交于 2019-12-02 11:56:37
I sent this HTTP POST request via Tasker (Android app) to my NodeMCU, which looks like this: POST / HTTP/1.1 Content-Type: application/x-www-form-urlencoded User-Agent: Tasker/4.9u4m (Android/6.0.1) Connection: close Content-Length: 10 Host: 192.168.0.22 Accept-Encoding: gzip <action>Play</action><SetVolume>5</SetVolume> I only want to extract what is between the "<action>" and "<SetVolume>" parameters. How can I do that? For the sake of completeness, here is another solution I came up with: string.gsub(request, "<(%a+)>([^<]+)</%a+>", function(key, val) print(key .. ": " .. val) end) A

Sntp.sync() ignores server

烂漫一生 提交于 2019-12-02 11:42:28
I've been trying to synchronize time with ntp servers, however, nodemcu seems to ignore the server parameter. -- sync.lua sntp.sync("fr.pool.ntp.org", function() tm = rtctime.epoch2cal(rtctime.get()) print(string.format("%04d/%02d/%02d %02d:%02d:%02d", tm["year"], tm["mon"], tm["day"], tm["hour"], tm["min"], tm["sec"])) end) Execution.. > dofile('sync.lua') > 2017/05/22 21:38:39 The time response is the unix epoch time ( https://www.epochconverter.com/ ). Is it supposed to be the server parameter time (in this case, France)? I tried several different servers (i.e http://www.pool.ntp.org/zone