intoyun / firmware Goto Github PK
View Code? Open in Web Editor NEW设备固件库,适用于IntoRobot系列产品
Home Page: https://www.intoyun.com/
License: GNU Lesser General Public License v3.0
设备固件库,适用于IntoRobot系列产品
Home Page: https://www.intoyun.com/
License: GNU Lesser General Public License v3.0
Completeness(完成点):
向用户提供mqtt 和 aJson wiring接口
Completeness(完成点):
nut web端端配置网络,获取ssid列表后配置网络出现重启现象。
Completeness(完成点):
neutron/nut/fig 模块联网后在进入配置模式,无法配置
Completeness(完成点):
neutron 出现程序下载成功,但是无法更新程序。同时无法恢复默认灯程序。
问题描述:
[nut][neutron] 无法通过web端串口配置设备
问题:
LoraWAN网关灌装密钥,不断电配置联网,无法接受平台控制。
Completeness(完成点):
fig 按配置按键退出配置模式会重启,不是每次都出现,出现几率很高。
如果注释掉wlan_Imlink_stop();正常。应该跟smartconfig有关。
void UdpDeviceConfig::close(void)
{
Udp.stop();
wlan_Imlink_stop();
}
assertion "timer_initialized(ptimer)" failed: file "/Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/esp32/./ets_timer_legacy.c", line 85, function: ets_timer_arm
abort() was called at PC 0x400d0ff7 on core 0
Backtrace: 0x40087f00:0x3ffccf40 0x40087fff:0x3ffccf60 0x400d0ff7:0x3ffccf80 0x40084379:0x3ffccfb0 0x40107c56:0x3ffccfd0 0x400d129f:0x3ffccff0 0x400d12fb:0x3ffcd010
Completeness(完成点):
如果引用带舵机程序,nut 进入配置模式,获取ssid列表或者配置网络,nut会重启。
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(ServoPin); // attaches the servo on pin 5 to the servo object
}
void loop()
{
}
Completeness(完成点):
代码如下:
void WakeupCb(void)
{
//重新初始化
if(Serial.isEnabled()){
Serial.end();
}
Serial.begin(115200);
Serial.printf("wakup\r\n");
}
// setup函数, 上电后或者复位后只运行一次
void setup()
{
// LED_BUILTIN数字管脚设置为输出
pinMode(LED_BUILTIN, OUTPUT);
Serial2.begin(115200);
System.sleep(WakeupCb,30);//休眠30s
}
// loop函数, 循环执行
void loop()
{
digitalWrite(LED_BUILTIN, HIGH); // 数字管脚输出高电平(点亮LED灯)。 请注意: 部分模块LED管脚控制逻辑相反(例如输出高电平。LED灯灭)。
delay(1000); // 等待1秒钟
digitalWrite(LED_BUILTIN, LOW); // 数字管脚输出低电平(熄灭LED灯)
delay(1000); // 等待1秒钟
}
Completeness(完成点):
fig bootloader 添加硬件定时器, 实现配置模式切换和三色灯处理。
Completeness(完成点):
anytest测试板用的是stm32f103,其串口接收很多字节(大概500字节以上)的数据时,无法完整接收。
Completeness(完成点):
fig 不支持子系统版本升级
Completeness(完成点):
@baoxianzhang usb_hal.c 是空的,现在无法通过SerialUSB打印信息,查看下是什么原因
程序:
//SerialDebugOutput debugOutput(115200, ALL_LEVEL);
#define LEDPIN LED_BUILTIN //例子灯
void setup()
{
pinMode(LEDPIN, OUTPUT);
}
void loop()
{
digitalWrite(LEDPIN, LOW);
delay(1000);
digitalWrite(LEDPIN, HIGH);
delay(1000);
}
编译选项
make PLATFORM=nut all DEBUG_BUILD=y USE_SWD=y APP=Blink esptool
Completeness(完成点):
esp32 目前实现舵机控制接口,需添加
Completeness(完成点):
如下示例,如果应用程序接管三色灯,配置模式三色灯指示不对
void setup()
{
RGB.control(true);
RGB.color(0x0000ff);
}
void loop()
{
}
Completeness(完成点):
Completeness(完成点):
如题
nut 每次串口下载后,软件调用软件复位无法重启
Completeness(完成点):
** 功能描述 **
提供硬件定时器接口,为应用层提供精准定时
Completeness(完成点):
添加arduino头文件,兼容arduino库
#include "IPAddress.h"
#include "Client.h"
#include <EEPROM.h>
Completeness(完成点):
nut 不支持子系统版本升级
Completeness(完成点):
Completeness(完成点):
< Please summarize your issue here. Check [x] as many boxes below as you can before submitting your issue. Thanks -- you rock! >
现在ant板的DAC,帮助文件中有一些问题。数据定义是uint8,但是例子中给的参考数据是0-4095.这是一个问题。
第二个个问题,时间用ant做输出的时候,不管输出什么值,到对应插针测量都没有电压输出。
Completeness(完成点):
1. Ant设备采取事件方式运行,设备可能出现一直无法入网。
2. Ant设备采取事件方式运行,经过一段时间后,设备可能会出现无法上送数据的现象。
#include "project_config.h"
SerialDebugOutput debugOutput(115200, ALL_LEVEL);
PRODUCT_ID(PRODUCT_ID_DEF) // 产品标识
PRODUCT_SECRET(PRODUCT_SECRET_DEF) // 产品密钥
PRODUCT_SOFTWARE_VERSION(SOFTWARE_VERSION_DEF) // 产品软件版本号
/*!
* Defines the application data transmission duty cycle. 5s, value in [ms].
*/
#define APP_TX_DUTYCYCLE 20000
/*!
* Defines a random delay for application data transmission duty cycle. 2s,
* value in [ms].
*/
#define APP_TX_DUTYCYCLE_RND 2000
/*!
* Defines the application data transmission duty cycle
*/
static uint32_t TxDutyCycleTime;
//运行流程
static enum eDeviceState
{
DEVICE_STATE_IDLE = 0,
DEVICE_STATE_WAIT,
DEVICE_STATE_JOIN,
DEVICE_STATE_SEND,
DEVICE_STATE_SLEEP
} deviceState;
#define DPID_INT32_FLOW 1 //数值型 流量
#define DPID_INT32_TIME 2 //数值型 传播时间
int32_t dpInt32Flow; // 流量
int32_t dpInt32Time; // 传播时间
uint32_t TxNextPacketTimerID;
uint32_t flowtimerID;
uint32_t WaittimerID;
bool isFirstSend = true;
void system_event_callback(system_event_t event, int param, uint8_t *data, uint16_t datalen)
{
switch(event) {
case event_cloud_comm:
switch(param) {
case ep_cloud_comm_data:
/*************此处修改和添加用户控制代码*************/
/****************************************************/
break;
default:
break;
}
break;
case event_lorawan_status:
switch(param) {
case ep_lorawan_join_success:
case ep_lorawan_join_fail:
deviceState = DEVICE_STATE_IDLE;
if(param == ep_lorawan_join_success) {
LoRaWan.setMacClassType(CLASS_C);
}
TxDutyCycleTime = APP_TX_DUTYCYCLE + random( -APP_TX_DUTYCYCLE_RND, APP_TX_DUTYCYCLE_RND );
TxNextPacketTimerID = timerGetId();
break;
case ep_lorawan_send_success:
case ep_lorawan_send_fail:
deviceState = DEVICE_STATE_IDLE;
break;
default:
break;
}
break;
default:
break;
}
}
void userInit(void)
{
//定义数据点事件
System.on(event_all, system_event_callback);
//根据网关参数具体设置
LoRaWan.setChannelStatus(0, false); //关闭通道0 频率固定:433175000
LoRaWan.setChannelStatus(1, false); //关闭通道1 频率固定:433375000
LoRaWan.setChannelStatus(2, true); //关闭通道2 频率固定:433575000
LoRaWan.setChannelFreq(2, 433775000); //设置通道2频率
LoRaWan.setChannelDRRange(2, DR_3, DR_3); //设置通道2速率范围
LoRaWan.setChannelStatus(3, false); //打开通道3
//定义产品数据点
Cloud.defineDatapointNumber(DPID_INT32_FLOW, DP_PERMISSION_UP_ONLY, 0, 4294967295, 0, 0); //流量
Cloud.defineDatapointNumber(DPID_INT32_TIME, DP_PERMISSION_UP_ONLY, 0, 4294967295, 0, 0); //传播时间
deviceState = DEVICE_STATE_JOIN;
/*************此处修改和添加用户初始化代码**************/
Serial.begin(115200);
//delay(random(0, 20000)); //随机延时,防止设备同时上电同时接入网络
flowtimerID = timerGetId();
/*******************************************************/
}
void userHandle (void)
{
/*************此处修改和添加用户处理代码****************/
switch(deviceState)
{
case DEVICE_STATE_JOIN:
deviceState = DEVICE_STATE_WAIT;
Cloud.connect(JOIN_OTAA, 0);
break;
case DEVICE_STATE_SEND:
//更新数据点数据(数据点具备上送属性)
Cloud.writeDatapoint(DPID_INT32_FLOW, dpInt32Flow);
Cloud.writeDatapoint(DPID_INT32_TIME, dpInt32Time);
if(Cloud.sendDatapointAll(false, 0) > 0) {
deviceState = DEVICE_STATE_WAIT;
} else {
deviceState = DEVICE_STATE_IDLE;
}
TxDutyCycleTime = APP_TX_DUTYCYCLE + random( -APP_TX_DUTYCYCLE_RND, APP_TX_DUTYCYCLE_RND );
TxNextPacketTimerID = timerGetId();
break;
case DEVICE_STATE_SLEEP:
deviceState = DEVICE_STATE_IDLE;
break;
case DEVICE_STATE_WAIT: //正在处理发送
break;
case DEVICE_STATE_IDLE: //空闲状态
if(timerIsEnd(TxNextPacketTimerID, TxDutyCycleTime)) { //处理间隔,用户可自行更改
if(Cloud.connected() == 0) { //连接上
deviceState = DEVICE_STATE_SEND;
} else {
deviceState = DEVICE_STATE_JOIN;
}
}
break;
default:
break;
}
/*******************************************************/
}
void setup ()
{
userInit();
Serial.begin(4800);
//Serial.println("Hello Computer");
}
void loop ()
{
//loop 尽量不要阻塞
userHandle();
}
Completeness(完成点):
问题描述:
neutron程序运行一段时间,开机会停留在浅蓝色灯上。
原因分析:
把neutron设置成串口转发默认,发现esp8266已经无法通过AT指令进行通讯。说明esp8266程序已经崩溃,重启也无法工作。重新烧入esp8266程序后,neutron正常工作。
通过analogWriteResolution更改pwm的resolution之后(例如:analogWriteResolution(D0,16)), 使用analogWrite函数,无法生成正确占空比的pwm。
分析原因是
Hal层中pwm_hal.c 内函数HAL_PWM_Set_Resolution为空:
即hal/src/neutron/pwm_hal.c
217 void HAL_PWM_Set_Resolution(uint16_t pin, uint8_t resolution)
218 {
219 }
Completeness(完成点):
Completeness(完成点):
问题描述:
neutron 运行一段时间后,会出现死机现象。
fig smartconfig配置到一个路由器后, 无法配置到另外一个路由器
Completeness(完成点):
Completeness(完成点):
现象:操作A0是,hal 获取A0映射pin错误,本应该是0x4 结果读出来是0x1。
Completeness(完成点):
Completeness(完成点):
Completeness(完成点):
Completeness(完成点):
Completeness(完成点):
运行SDK 示例程序。 nut 出现重启现象。
代码如下
TCPServer server = TCPServer(23);
TCPClient client;
void setup()
{
// start listening for clients
server.begin();
// Make sure your Serial Terminal app is closed before powering your Core
Serial.begin(9600);
// Now open your Serial Terminal, and hit any key to continue!
while(!Serial.available());
Serial.println(WiFi.localIP());
Serial.println(WiFi.subnetMask());
Serial.println(WiFi.gatewayIP());
Serial.println(WiFi.SSID());
}
void loop()
{
if (client.connected())
{
// echo all available bytes back to the client
while (client.available())
{
server.write(client.read());
}
}
else
{
// if no client is yet connected, check for a new connection
client = server.available();
}
}
Completeness(完成点):
Completeness(完成点):
nut 编译多个库后,提示空间不足
Completeness(完成点):
Completeness(完成点):
需要增加硬件定时器,现有的操作系统级别的软件定时器可能会不准
Completeness(完成点):
< Please summarize your issue here. Check [x] as many boxes below as you can before submitting your issue. Thanks -- you rock! >
< 请在这把你的问题描述清楚。提交issue之前通过[x], 确定下面的完成点 >
通过测试程序验证问题:未接从设备运行程序,Wire.endTransmission()均返回0,即: 传输成功
#include <Wire.h>
//int PIN_I2C_SCL = GPIO19;
//int PIN_I2C_SDA = GPIO23;
void setup(){
Wire.begin();
Serial.begin(9600);
Serial.println("\nI2C Scanner");
}
void loop(){
byte error, address;
int nDevices;
Serial.println("Scanning...");
nDevices = 0;
for (address = 1; address < 127; address++ ){
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0){
Serial.print("I2C device found at address 0x");
if (address < 16)
Serial.print("0");
Serial.print(address, HEX);
Serial.println(" !");
nDevices++;
}else if (error == 4){
Serial.print("Unknow error at address 0x");
if (address < 16)
Serial.print("0");
Serial.println(address, HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");
delay(5000); // wait 5 seconds for next scan
}
Completeness(完成点):
代码:
String usbMsg = "";
String serial1Msg = "";
unsigned char c;
void setup()
{
// put your setup code here, to run once.
SerialUSB.begin(19200);
Serial1.begin(19200);
}
void loop()
{
// put your main code here, to run repeatedly.
while(SerialUSB.available()>0)
{
usbMsg = usbMsg+(char)SerialUSB.read();
}
if(usbMsg!="")
{
SerialUSB.println(usbMsg);
Serial1.println(usbMsg);
usbMsg="";
}
while(Serial1.available()>0)
{
c=Serial1.read();
serial1Msg = serial1Msg+(char)c;
// SerialUSB.print("c=");
// SerialUSB.println((char)c);
// SerialUSB.print("serial1Msg=");
// SerialUSB.println(serial1Msg);
}
if(serial1Msg!="")
{
SerialUSB.println(serial1Msg);
//Serial1.println(serial1Msg);
serial1Msg="";
}
}
Completeness(完成点):
Completeness(完成点):
模组W32
int *** = GPIO26;
先在GPIO26输出PWM 127, 200,示波器测试正常输出
analogWrite(, 127, 200); //输出脉冲200HZ,宽度50%
然后关闭GPIO26的PWM输出,示波器测试未完全关断。
analogWrite(, 0, 0); //关闭脉冲输出
此问题需先输出,然后关断才会出现问题,模组上电、复位,GPIO26均输出低电位
< Please summarize your issue here. Check [x] as many boxes below as you can before submitting your issue. Thanks -- you rock! >
< 请在这把你的问题描述清楚。提交issue之前通过[x], 确定下面的完成点 >
Completeness(完成点):
问题:
neutron/nut 部分公有库和示例程序无法编译成功,以下库无法编译成功:OLED/GP2Y10/DHT11/
YL38/MQ2/GY30/WidgetoptCtrlLamp
原因:
报错NONE未声明和u8 u6 u32类型不存在
程序添加烟雾传感器和湿度传感器模块,联网不久平台提示断网,但设备还是白灯闪烁
Completeness(完成点):
< Please summarize your issue here. Check [x] as many boxes below as you can before submitting your issue. Thanks -- you rock! >
< 请在这把你的问题描述清楚。提交issue之前通过[x], 确定下面的完成点 >
W33模组,通过I2C连接测距模块vl53l0x,频繁读取距离数据会出现程序运行停顿现象(无任何反应,系统未打印错误信息,停顿时间不等,然后恢复程序运行)
#include <ModbusMaster.h>
#include "Arduino.h"
#include "Wire.h"
#include "IntoYunIot_VL53L0X.h"
IntoYunIot_VL53L0X sensor;
ModbusMaster node;
void setup() {
//initialize serial communication at 9600 bits per second:
Serial.begin(9600);
//join i2c bus (address optional for master)
Wire.begin();
//Set I2C sub-device address
sensor.begin(0x50);
//Set to Back-to-back mode and high precision mode
sensor.setMode(Continuous,Low);
//Laser rangefinder begins to work
sensor.start();
Serial1.begin(9600);
node.begin(2,Serial1);
}
void loop()
{
//Get the distance
uint8_t j, result;
result = node.writeSingleCoil(0x040B, 0xFF);
Serial.println(sensor.getDistance());
delay(100);
}
Completeness(完成点):
fig 软件定时器不工作,具体程序如下:
void print_every_second()
{
static int count = 0;
Serial.println(count++);
}
Timer timer(1000, print_every_second);
void setup()
{
Serial.begin(115200);
timer.start();
}
void loop()
{
}
Completeness(完成点):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.