-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
Signed-off-by: Michael Heimpold <[email protected]>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk | |
|
||
PKG_NAME:=ser2net | ||
PKG_VERSION:=3.5 | ||
PKG_RELEASE:=1 | ||
PKG_RELEASE:=2 | ||
|
||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz | ||
PKG_SOURCE_URL:=@SF/ser2net | ||
|
@@ -43,13 +43,16 @@ endef | |
|
||
define Package/ser2net/install | ||
$(INSTALL_DIR) $(1)/usr/sbin | ||
$(CP) $(PKG_INSTALL_DIR)/usr/sbin/ser2net $(1)/usr/sbin/ | ||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ser2net $(1)/usr/sbin/ | ||
|
||
$(INSTALL_DIR) $(1)/etc | ||
$(INSTALL_CONF) $(PKG_BUILD_DIR)/ser2net.conf $(1)/etc/ | ||
|
||
$(INSTALL_DIR) $(1)/etc/config | ||
$(INSTALL_CONF) ./files/etc/config/ser2net $(1)/etc/config/ser2net | ||
$(INSTALL_CONF) ./files/ser2net.config $(1)/etc/config/ser2net | ||
|
||
$(INSTALL_DIR) $(1)/etc/init.d | ||
$(INSTALL_BIN) ./files/etc/init.d/ser2net $(1)/etc/init.d/ser2net | ||
$(INSTALL_BIN) ./files/ser2net.init $(1)/etc/init.d/ser2net | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mhei
Author
Owner
|
||
endef | ||
|
||
$(eval $(call BuildPackage,ser2net)) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# | ||
# This is a minimal example configuration file for ser2net. For a version with | ||
# detailed comments and all possible configuration directives, please visit: | ||
# https://github.com/cminyard/ser2net/blob/master/ser2net.conf | ||
# | ||
# On OpenWrt/LEDE systems, this configuration serves as a base configuration. | ||
# During boot of the system, the UCI configuration file /etc/config/ser2net is | ||
# parsed and converted to additional configuration lines which are _appended_ | ||
# to this file. The ser2net daemon is then started with the combined | ||
# configuration file /tmp/ser2net.conf. | ||
# | ||
# A basic service configuration line has the following format: | ||
# <network port>:<state>:<timeout>:<device>:<options> | ||
# network port | ||
# Name or number of the port to accept connections | ||
# from for this device. A port number may be of the form | ||
# [ipv4,|ipv6,][tcp,|udp,][host,]port, such as | ||
# 127.0.0.1,2000 or ipv4,tcp,localhost,2000. If the host is | ||
# specified, it will only bind to the IP address | ||
# specified. Otherwise it will bind to all the ports on the | ||
# machine. If ipv4 or ipv6 is specified, it will only bind | ||
# to that network type. | ||
# | ||
# state | ||
# Either raw or rawlp or telnet or off. off disables | ||
# the port from accepting connections. It can be | ||
# turned on later from the control port. raw enables | ||
# the port and transfers all data as-is between the | ||
# port and the long. rawlp enables the port and | ||
# transfers all input data to device, device is open | ||
# without any termios setting. It allow to use | ||
# /dev/lpX devices and printers connected to them. | ||
# telnet enables the port and runs the telnet proto- | ||
# col on the port to set up telnet parameters. This | ||
# is most useful for using telnet. | ||
# | ||
# timeout | ||
# The time (in seconds) before the port will be dis- | ||
# connected if there is no activity on it. A zero | ||
# value disables this function. | ||
# | ||
# device | ||
# The name of the device to connect to. This | ||
# must be in the form of /dev/<device>. | ||
# | ||
# options | ||
# Sets operational parameters for the serial port. | ||
# For a serial device (not IPMI SOL): | ||
# Options 300, 1200, 2400, 4800, 9600, 19200, 38400, | ||
# 57600, 115200 set the various baud rates. EVEN, | ||
# ODD, NONE (MARK and SPACE if supported) set the parity. | ||
# Note that MARK and SPACE are not available on all systems | ||
# or hardware, if it is not supported then it will be | ||
# silently set to ODD or EVEN parity. | ||
# 1STOPBIT, 2STOPBITS set | ||
# the number of stop bits. 5DATABITS, 6DATABITS, | ||
# 7DATABITS, 8DATABITS set the number of data bits. | ||
# [-]XONXOFF turns on (- off) XON/XOFF support. | ||
# [-]RTSCTS turns on (- off) hardware flow control, | ||
# [-]LOCAL turns off (- on) monitoring of the modem lines, | ||
# and [-]HANGUP_WHEN_DONE turns on (- off) lowering the | ||
# modem control lines when the connection is done. | ||
# [-]NOBREAK disables automatic setting of the break | ||
# setting of the serial port. | ||
# | ||
# The "[-]remctl" option allow remote control (ala RFC | ||
# 2217) of serial-port configuration. | ||
# | ||
# Example: | ||
# 5000:telnet:0:/dev/ttyAPP0:115200 8DATABITS NONE 1STOPBIT -XONXOFF -LOCAL -RTSCTS remctl |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
config global | ||
option enabled 1 | ||
|
||
config controlport | ||
option enabled 0 | ||
option host localhost | ||
option port 2000 | ||
|
||
config default | ||
option speed 115200 | ||
option databits 8 | ||
option parity 'none' | ||
option stopbits 1 | ||
option rtscts false | ||
option local false | ||
option remctl true | ||
|
||
#config led rx | ||
# option driver sysfs | ||
# option device 'duckbill:green:rs485' | ||
# option duration 20 | ||
# option state 1 | ||
|
||
#config led tx | ||
# option driver sysfs | ||
# option device 'duckbill:red:rs485' | ||
# option duration 20 | ||
# option state 1 | ||
|
||
config proxy | ||
option enabled 0 | ||
option port 5000 | ||
option protocol telnet | ||
option timeout 0 | ||
option device '/dev/ttyAPP0' | ||
option baudrate 115200 | ||
option databits 8 | ||
option parity 'none' | ||
option stopbits 1 | ||
# option led_tx 'tx' | ||
# option led_rx 'rx' | ||
option rtscts false | ||
option local false | ||
option xonxoff false | ||
list options '' | ||
|
||
config proxy | ||
option enabled 0 | ||
option port 5001 | ||
option protocol telnet | ||
option timeout 0 | ||
option device '/dev/ttyUSB0' | ||
option baudrate 115200 | ||
option databits 8 | ||
option parity 'none' | ||
option stopbits 1 | ||
|
||
config proxy | ||
option enabled 0 | ||
option port 5002 | ||
option protocol raw | ||
option timeout 0 | ||
option device '/dev/ttyUSB1' | ||
option baudrate 9600 | ||
option databits 8 | ||
option parity 'none' | ||
option stopbits 1 |
6 comments
on commit 1dd54f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, this will work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing you conf/config/init files but are you sure they work?
It seems that (does not work):
config global
option enabled 1
config_get_bool enabled ser2net enabled 0
however this works:
config ser2net global
option enabled 1
config_get_bool enabled global enabled 0
When I try it without 'ser2net' in the config name, the resulting 'enable' boolean is always 0. I'm running LEDE 17.01.2 and just copied your scripts, which should be fine I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doohh, you are right. somehow this slipped through... I've commited a fix, please re-test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's correct now. ;)
One thing I personally do not understand. Why is 'ser2net' needed at the global section and not at all the other sections? It's working nevertheless, so thats fine. But I would like to understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimelessNL names vs types are a disaster in UCI, but so be it.
it's from
config_load ser2net
config_get_bool enabled ser2net enabled 0
vs
config_foreach blah
config_load ser2nnet loads /etc/config/ser2net,
config_get_bool is making a variable called enabled, from the section (type/name I never remember which is which) ser2net, option "enabled" with a default value of 0.
The _foreach just iterates all the sections of the type, regardless of name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmh interesting. Thanks for explaining!
this is just noise. What's it for in this commit? If you want to make chages, it looks like the existing stuff could just be converted to$(CP) files/ $ (1) and be done.