TinkerBoard 2s Serial Connection UART0 - uart

i am trying to connect my PC and my TinkerBoard 2s via UART0.
I found this forum post:
https://forums.debian.net/viewtopic.php?t=149981
which relates to this on page 11:
https://tinker-board.asus.com/images/doc/download/Tinker_Edge_R_Getting_Started.pdf
So what i already did is:
in /dev/config.txt
"intf:fiq_debugger=on" → "intf:fiq_debugger=off"
"#intf:uart0=off" → "intf:uart0=on"
"overlay=" → "overlay=console-uart0-overlay"
My Question now:
where do i have to put
uart1 = Serial("/dev/ttyS0=",115200)
uart3 = Serial("/dev/ttyS4=",9600)
I put it at the end of config.txt, but when i "cat /dev/ttyS0" on TinkerBoard and connect via PUTTY on COM3 and 115200, nothing happens...
Do i have to put it in the same file (config.txt)? or into the cmdline.txt?
Did i forgot something? Do I have to change "overlay=" -> "overlay=console-uart0-overlay"?
(I dont care if i will get to console or sending chars for now)
thank you

Related

Telit UL865 3G modem Hangs (Needs resetting) after AT#HTTPRCV=0

I'm using a Telit UL865-NAD to connect to a webpage to get data from a php file.
The main problem is that the HTTPRCV command hangs.
See code below:
OK
AT#CIMI
#CIMI: 730011235559846
OK
AT+CCID
+CCID: 89560100000992123469
OK
AT+CGMI
Telit
OK
AT+CGMM
UL865-NAD
OK
AT+CGMR
12.00.716
OK
AT+CGDCONT=1,"IP","imovil.entelpcs.cl"
AT+CGDCONT=1,"IP","imovil.entelpcs.cl"
OK
AT#SGACT=1,1
#SGACT: 10.166.148.143
OK
AT#HTTPCFG=0,"www.xxxx-xxxxxx.com",80,0,,,0,120,1
AT#HTTPCFG=0,"www.xxxx-xxxxxx.com",80,0,,,0,120,1
OK
AT#HTTPQRY=0,0,"/Inagrap/"
OK
#HTTPRING: 0,200,"text/html;charset=ISO-8859-1",1136
AT#HTTPRCV=0
The AT#HTTPQRY command, refers to the directory where the php file resides.
A second issue,
If I include the php file:
AT#HTTPQRY=0,0,"/Inagrap/my.php?D1=val1&D2=val2..."
The HTTPRING indicates '0' data
*** Edit Further info
If I test the page through a browser it gives me a response, yet
testing through the modem, HTTPRING indicates '0' data.
The page inserts the data passed in with the GET, to a database.
If I access the page through a browser, data gets inserted into the database.
But run through the modem, nothing happens.
It's strange the modem gives me responses indicating that I connect to the page, it indicates a http status of 200, yet no data is returned and the web code is not executed.
Why?
After the AT#SGACT command, an AT&K0 command is required to turn off flow control.
Two days wracking my brain for this simple omission.

How to solve the error "No Protocol specified" for ClusterSSH

I'm trying to setup ClusterSSH on my OpenSuse 15.1 - yet I'm getting an error and I've looked around and cannot find a solution.
mschumacher#Desktop:~/.clusterssh> cssh -l mschumacher 10.0.96.26
Connection to server failed -- (version 11.0)
No protocol specified
at /usr/lib/perl5/vendor_perl/5.26.1/App/ClusterSSH.pm line 1983.
In the file /home/mschumacher/.clusterssh/config I have..
#auto_close=5
#auto_quit=yes
#command=
#comms=ssh
#console=console
#console_args=
#console_position=
#debug=0
#external_cluster_command=
#extra_cluster_file=
#extra_tag_file=
#history_height=10
#history_width=40
#key_addhost=Control-Shift-plus
#key_clientname=Alt-n
#key_history=Alt-h
#key_localname=Alt-l
#key_macros_enable=Alt-p
#key_paste=Control-v
#key_quit=Alt-q
#key_retilehosts=Alt-r
#key_username=Alt-u
#lang=en
#macro_hostname=%h
#macro_newline=%n
#macro_servername=%s
#macro_username=%u
#macro_version=%v
#macros_enabled=yes
#max_addhost_menu_cluster_items=6
#max_host_menu_items=30
#menu_host_autotearoff=0
#menu_send_autotearoff=0
#mouse_paste=Button-2
#rsh=rsh
#rsh_args=
#screen_reserve_bottom=60
#screen_reserve_left=0
#screen_reserve_right=0
#screen_reserve_top=0
#send_menu_xml_file=/home/mschumacher/.clusterssh/send_menu
#sftp=sftp
#sftp_args=
#show_history=0
ssh=/usr/bin/ssh
#ssh_args=
#telnet=telnet
#telnet_args=
#terminal=xterm
#terminal_allow_send_events=-xrm '*.VT100.allowSendEvents:true'
#terminal_args=
#terminal_bg_style=dark
#terminal_colorize=1
#terminal_decoration_height=10
#terminal_decoration_width=8
#terminal_font=6x13
#terminal_reserve_bottom=0
#terminal_reserve_left=5
#terminal_reserve_right=0
#terminal_reserve_top=5
#terminal_size=80x24
#terminal_title_opt=-T
#title=CSSH
#unmap_on_redraw=no
#use_all_a_records=0
#use_hotkeys=yes
#use_natural_sort=0
#window_tiling=yes
#window_tiling_direction=right
user=mschumacher
I'll keep digging around to see if I can figure out what the issue(s) are, but hopefully, it will be something simple to do.
My solution:
Log in as root. Type in the command "xhost +", which should come back with "access control disabled, clients can connect from any host". Exit out of root and able to use cssh.

How to handle errors from reqMktData calls

Are there any examples on the net how to process errors when downloading data from Interactive Brokers using the IBrokers package? I've had a look at the package details and eWrapper and twsCALLBACK seem to handle this but I can't get them to work. For example the code below produces an error and R hangs, the error msg isn't processed. Thanks for any suggestions.
contract <- twsContract(0,
symbol="SPI",
sectype="XXX", #bad sectype
exch="SNFE",
primary="",
expiry= "20181220",
strike="",
currency="AUD",
right="",
local="",
multiplier = "25",
combo_legs_desc = "",
comboleg = "",
include_expired = "",
secIdType = "",
secId = "")
tws <- twsConnect()
data <- reqMktData(tws,contract,snapshot = TRUE)
You should append a "Disconnect" command to you code. Otherwise your program try to build to connections on the same port, that's not possible and it will not terminate.
I don't know the IBroker package very well, please check the command for disconnecting and append it to your code. Refresh your command line and rerun your code.
In addition, connect to IB Gateway instead of TWS by using that port number (check API settings of your IB Gateway application). In the settings choose a detailed Log.
Run your code again (after changing port number) and send your log file. Then I will try to help more. It's hard to help without any error message.

NoFlo - how to start a graph / network

Pure Data has a loadbang component, which does what it says: sends one bang when the graph starts running. NoFlo's core/Kick doesn't send its data until its IN input is hit, and you can't save a bang IIP in noflo-ui.
core/Repeat with an IIP (any string) on the IN port will do what you're looking for. Here is a browser example that shows a popup alert when the network starts:
loadbang(core/Repeat) OUT -> IN alert(core/MakeFunction)
'alert("hi");' -> FUNCTION alert
':-)' -> IN loadbang
Related discussion: https://github.com/noflo/noflo-ui/issues/97

Serial communication error in objective-C: Resource busy

I'm writing some code which purpose is to read values send by an ECG.
The ECG sends values read by it's sensors through a serial connection and (as a start) all the program has to do is read the input and display it in a text view.
However I have hit a wall and can't seem to solve the following two problems:
I get the following error a lot of the times I try to connect with the ECG: Unable to open /dev/tty.usbserial.A700eLwM - : Resource busy.
The port is not being used by any other applications but the ECG is sending numbers.
Can I somehow tell the OS that whatever is happening and whoever is using that port I want to have full control of the port?
My code is as follows:
fd = open("/dev/tty.usbserial-A700eLwM", O_RDWR | O_NOCTTY | O_NDELAY);
[textView insertText:[NSString stringWithFormat:#"Port status: %f\n", fd]];
if (fd == -1)
{
/*
* Could not open the port.
*/
perror("open_port: Unable to open /dev/tty.usbserial.A700eLwM - ");
}
else {
fcntl(fd, F_SETFL, 0);
}
My second problem is that I don't quite understand how I can buffer the reading into a string or integer variable and send it to the text view.
Any help will be appreciated
Thanks in advance
The most likely reason is that you've activated the serial port as a network device in Network Preferences. If it's listed there, select it and use the cogwheel menu item "mark as inactive".
For your second problem there's a lot of other matching questions on the site, search for it.