Giter Site home page Giter Site logo

rt-thread-packages / netutils Goto Github PK

View Code? Open in Web Editor NEW
65.0 16.0 59.0 8.21 MB

IoT networking utilities for RT-Thread. Such as: ping, tftp, iperf, netio, ntp, telnet and tcpdump.

License: Apache License 2.0

Python 1.02% C 98.98%
iot debug tools utils tcpdump tftp ping iperf ntp

netutils's Introduction

RT-Thread Network Gadgets Collection

Chinese | English

1 Introduction

When RT-Thread is connected to the network, the playability is greatly enhanced. Here is a collection of all the web widgets available for RT-Thread, and all the widgets you need can be found here.

2. How to obtain

Please use ENV tool to assist download:

The path of the package is: RT-Thread online package -> IoT-internet of things -> netutils

3. Instructions for use

Each gadget can be enabled/disabled independently using menuconfig and provides commands for using Finsh/MSH. There is a detailed usage document in its catalog. If you need to use it, please check separately. The following is a summary of currently supported gadgets:

Name Classification Function Introduction Use Document
Ping Debugging test Use the "ping" command to check whether the network is connected, which can help us analyze and determine network failures click to view
TFTP File transfer TFTP is a simple protocol for transferring files, which is lighter than FTP click to view
iperf Performance Test Test maximum TCP and UDP bandwidth performance, report bandwidth, delay jitter and packet loss Click to view
NetIO Performance Test Tools for testing network throughput Click to view
NTP Time synchronization Network time protocol, support 3 alternative servers Click to view
Telnet Remote access Can remotely log in to RT-Thread's Finsh/MSH Shell Click to view
tcpdump Network debugging tcpdump is RT-Thread's lwip-based network packet capture tool Click to view

netutils's People

Contributors

armink avatar bernardxiong avatar chenxuanzhao avatar cnmayuncn avatar enkiller avatar gbcwbz avatar guozhanxin avatar helloeagleyang avatar kurisaw avatar lawlieta avatar liangyongxiang avatar liu2guang avatar murphyzhao avatar mysterywolf avatar qiyongzhong0 avatar summergift avatar tjrong avatar tttturtle-russ avatar xiangxistu avatar yangjie11 avatar yangpengya avatar yazoobao avatar zmshahaha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

netutils's Issues

ntp向三个服务器获取时间,每次都是使用的第一个服务器的IP

image
见上图,发现每次NTP其实都是使用的第一个服务器dns出来的IP。我看了半天代码,没看出来为什么?
我使用的是AT组件,AT设备是SIM7600,
SIM7600的DNS部分,我跟了代码,发现IP是获取到了。

另外,我发现当获取ntp失败时,堆栈会溢出,当前的1.5K不够用,我是将1.5K乘2以后,发现ntp失败不会死机的。

能从工具软件的Server读取文件,但是无法从linux上的TFTP服务器读取文件

stm32直接连接工具软件Tftp64上的Server 能正常获取文件,但stm32直接连接服务器上的TFTP,读取文件 却无法获取结果 无任何反馈

工具软件Tftp64上的client去连接服务器下载文件,完全正常 下图右侧是相应请求过程

是因为stm32这边的请求格式不完整的原因么 应该如何修复?
相应抓包结果见下方链接
https://www.rt-thread.org/qa/forum.php?mod=viewthread&tid=2289&page=1&authorid=15749

新版本的 NTP 同步无法同步日期只能同步时间

涉及到这次改动:1e02f87

源文件377行设置date和time分别用了两次localtime. 新版删掉后导致NTP 同步无法同步日期只能同步时间

单步调试发现,先进行set_time的情况下,set_time之后,日期被重置,时间保留。
我现在先设置日期,再设置时间,可以同步日期并且同步时间。

获取时间正确。
image
年月被重置成RTC原先的时间。
image

这个问题可能跟底层RTC驱动有关。
STM32L476

RTT的TFTP作为服务端,上传到RTT的文件保存在根目录时,RTT再打开改文件出现打开异常

RTT的TFTP作为服务端,linux使用TFTP工具当作客户端上传文件到RTT 文件系统根目录时,显示上传成功。
再RTT的文件系统根目录也可以看见改文件,cat文件后内容也正常,但是使用open API 以绝对路径打开(/filename)打开该文件返回-1.

原因是保存文件到根目录时的判断对象错误,修改为full_path后测试正常
图片
图片

hard fault on thread: tcpip

开发板:正点原子探索者407ZG RTT:3.0.4
按照使用说明,点击PUT之后出现
msh />psr: 0x61000000
pc: 0x08009030
lr: 0x08009031
r12: 0x00000000
r03: 0x20000208
r02: 0x20000208
r01: 0x2000fa44
r00: 0x00000000
hard fault on thread: tcpip
thread pri status sp stack size max used left tick error


tshell 20 suspend 0x00000140 0x00001000 07% 0x00000006 000
tcpip 10 close 0xfffffd0f 0x0000004b 100% 0x2000f9bf 000
etx 12 ready 0x00000098 0x00000400 14% 0x00000010 000
erx 12 ready 0x000000e0 0x00000400 53% 0x00000010 000
tidle 31 ready 0x00000048 0x00000100 34% 0x0000001c 000

tftp 读取文件文件名为特定长度 会导致程序崩溃

如果读取slin.log.0, erpc.log.0 程序会崩溃 ,读取文件名为module.log.0 程序正常

调试后发现内存分配长度没有考虑\0, 由于malloc分配以字节对齐方式分配,当文件名不是对齐字节长度的整数倍,malloc会多分配一些字节以保证内存对齐,某些文件名长度正好是整数倍时,出现内存越界,导致程序崩溃

图片

使用ec20网卡进行ntp同步只能与第一个服务器进行时间同步

查看代码并使用AT调试发现,虽然设置了三个NTP服务器但是在socket连接的时候只与第一个服务器建立了UDP连接,之后的两个还使用的第一个连接,导致三次同步实际都与第一个服务器进行,但是使用w5500抓包发现是单独与每个服务器进行的连接。
建立连接的地方(会分别向每个服务器发送同步请求,只有第一次建立连接):
image
代码最后才关闭socket(一次操作):
image

tftp tftp_file_open return local pointer in tftp_port.c

void *tftp_file_open(const char *fname, const char *mode, int is_write)
{
int fd = 0;

if (!strcmp(mode, "octet"))
{
    if (is_write)
    {
        fd = open(fname, O_WRONLY | O_CREAT, 0);
    }
    else
    {
        fd = open(fname, O_RDONLY, 0);
    }
}
else
{
    printf("tftp: No support this mode(%s).", mode);
}

return (void *)fd;

}

ntp超时问题

使用NTP同步网络时间,使用中出现一个问题
系统运行,一直提示 “[E/NTP]: ERROR select the socket timeout(5s)”
但是使用msh命令 ntp_sync立即就能同步时间成功,如图。
_20180911201454

netutils V1.3 ntp_sync 的堆栈太小了

RT-Thread 版本: master (5ba96109c60c4b1a)
netutils 版本: V1.2 V1.3
现象: 出现提示warning: ntp_sync stack is close to end of stack address,也出过堆栈溢出

[I/ntp] Get local time from NTP server: Wed May 19 18:23:40 2021

[I/ntp] Get local time from NTP server: Wed May 19 18:25:40 2021

warning: ntp_sync stack is close to end of stack address.
warning: ntp_sync stack is close to end of stack address.
[I/ntp] Get local time from NTP server: Wed May 19 18:27:40 2021

[I/ntp] Get local time from NTP server: Wed May 19 18:29:40 2021

[I/ntp] Get local time from NTP server: Wed May 19 18:31:40 2021

[I/ntp] Get local time from NTP server: Wed May 19 18:33:40 2021

[I/ntp] Get local time from NTP server: Wed May 19 18:35:40 2021

ps
thread   pri  status      sp     stack size max used left tick  error
-------- ---  ------- ---------- ----------  ------  ---------- ---
tshell    20  running 0x000002c0 0x00001000    17%   0x00000005 000
PLC       13  suspend 0x000000b0 0x00002000    04%   0x00000001 000
DI/DO     12  suspend 0x000000c0 0x000002a8    28%   0x00000001 000
inj_test  20  suspend 0x000000ac 0x00000200    33%   0x00000001 000
telnet    26  suspend 0x00000210 0x00001000    20%   0x00000064 000
acon      19  suspend 0x00000114 0x00000800    13%   0x00000064 000
AutoSave   0  suspend 0x0000009c 0x00000800    08%   0x00000005 000
ebThread  30  suspend 0x000000ac 0x00000100    67%   0x0000000a 000
syswatch   0  suspend 0x000000a4 0x00000200    56%   0x0000000e 000
ntp_sync  30  suspend 0x000000a4 0x00000514    98%   0x00000002 000
sys_work  23  suspend 0x0000010c 0x00000af0    47%   0x0000000a 000
tcpip     10  suspend 0x000000f0 0x00000400    77%   0x00000010 000
etx       12  suspend 0x000000ac 0x00000800    17%   0x00000010 000
erx       12  suspend 0x000000bc 0x00000800    32%   0x0000000b 000
tidle0    31  ready   0x00000078 0x00000400    16%   0x0000001b 000
main      10  suspend 0x00000148 0x00000800    57%   0x00000003 000

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.