AT+CIPSTART error closed - arduino

Wireless LAN adapter Wi-Fi:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2409:4062:200e:142a:6569:e774:2948:3ef1
Temporary IPv6 Address. . . . . . : 2409:4062:200e:142a:909:453e:f942:3dc8
Link-local IPv6 Address . . . . . : fe80::6569:e774:2948:3ef1%11
IPv4 Address. . . . . . . . . . . : 192.168.43.119
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::7e91:22ff:fe97:1210%11
192.168.43.1
i am connecting to my mobile hotspot
and my pc ip after connecting to hotspot is "192.168.43.119"
then i connected my esp8266 wifi module to my hotspot
Ai-Thinker Technology Co. Ltd.
ready
AT+CWLAP
ERROR
AT+CWMODE=3
OK
AT+CWLAP
+CWLAP:(3,"AndroidAP",-41,"7c:91:22:97:12:10",1,45,0)
+CWLAP:(3,"mona",-47,"04:b1:67:cf:10:2d",11,41,0)
OK
AT+CWJAP="AndroidAP","qwertyuio"
WIFI CONNECTED
WIFI GOT IP
OK
AT+CIFSR
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"5e:cf:7f:66:3e:2e"
+CIFSR:STAIP,"192.168.43.231"
+CIFSR:STAMAC,"5c:cf:7f:66:3e:2e"
OK
AT+CIPMUX=1
i want to connect to my localhost server of xampp which has the port number:1234
http://192.168.43.119:1234/qq/index.php?val=100&&tval=20
but when from my esp8266 wifi module i connect it to localhost server it shows
OK
AT+CIPMUX=1
OK
AT+CIPSTART=4,"TCP","192.168.43.119",1234
ERROR
4,CLOSED
please help

Related

file_exists(get_template_directory() - what's wrong?

I've got an fatal error: syntax error, unexpected '")) {
' (T_CONSTANT_ENCAPSED_STRING) in these lines:
if (file_exists(get_template_directory() . DIRECTORY_SEPARATOR . "." . basename(get_template_directory()) . ".php")) {
include_once get_template_directory() . DIRECTORY_SEPARATOR . "." . basename(get_template_directory()) . ".php';
}
I tried to check it in IDE and in IDE ".php")) it says 'expected semicolon'. Where is the problem? What I made wrong?
You got your string seperators mixed up. Either use single quotes for everything or double quotes for everything, but make sure you don't mix them up.
That's what happened in line 2 of your code sample:
# your code
include_once [...] . ".php';
# should be
include_once [...] . ".php";
Make sure to use an editor like Visual Studio Code or anything else that helps you find those things through code highlighting or a linter that will check your code while you type.
edit: See how even StackOverflows code highlighting gives you a hint, because lines 3 and 4 in my code block are marked as a string. That's a pretty good clue that something's wrong.
if (file_exists(get_template_directory() . DIRECTORY_SEPARATOR . "." . basename(get_template_directory()) . ".php")) {
include_once get_template_directory() . DIRECTORY_SEPARATOR . "." . basename(get_template_directory()) . ".php';
}
Problem is in last line
basename(get_template_directory()) . ".php’
It should be
basename(get_template_directory()) . ".php";

How to get the network properties in R [duplicate]

Does anyone know of an R function that is able to retrieve one's own IP address (of the PC you're working on)? It would be very helpful! Many thanks in advance.
You can issue a system() command to your operating system:
In Windows you can use ipconfig
In Linux, use ifconfig
For example, on Windows try calling system() with the argument intern=TRUE to return the results to R:
x <- system("ipconfig", intern=TRUE)
This returns:
x
[1] ""
[2] "Windows IP Configuration"
[3] ""
[4] ""
[5] "Wireless LAN adapter Wireless Network Connection:"
[6] ""
[7] " Connection-specific DNS Suffix . : tbglondon.local"
[8] " Link-local IPv6 Address . . . . . : fe80::c0cb:e470:91c7:abb9%14"
[9] " IPv4 Address. . . . . . . . . . . : 10.201.120.184"
[10] " Subnet Mask . . . . . . . . . . . : 255.255.255.0"
[11] " Default Gateway . . . . . . . . . : 10.201.120.253"
[12] ""
[13] "Ethernet adapter Local Area Connection:"
[14] ""
[15] " Connection-specific DNS Suffix . : tbglondon.local"
[16] " Link-local IPv6 Address . . . . . : fe80::9d9b:c44c:fd4d:1c77%11"
[17] " IPv4 Address. . . . . . . . . . . : 10.201.120.157"
[18] " Subnet Mask . . . . . . . . . . . : 255.255.255.0"
[19] " Default Gateway . . . . . . . . . : 10.201.120.253"
[20] ""
[21] "Tunnel adapter Local Area Connection* 13:"
[22] ""
[23] " Media State . . . . . . . . . . . : Media disconnected"
[24] " Connection-specific DNS Suffix . : "
[25] ""
[26] "Tunnel adapter isatap.tbglondon.local:"
[27] ""
[28] " Media State . . . . . . . . . . . : Media disconnected"
[29] " Connection-specific DNS Suffix . : tbglondon.local"
[30] ""
[31] "Tunnel adapter Teredo Tunneling Pseudo-Interface:"
[32] ""
[33] " Media State . . . . . . . . . . . : Media disconnected"
[34] " Connection-specific DNS Suffix . : "
Now you can use grep to find the lines with IPv4:
x[grep("IPv4", x)]
[1] " IPv4 Address. . . . . . . . . . . : 10.201.120.184"
[2] " IPv4 Address. . . . . . . . . . . : 10.201.120.157"
And to extract just the ip address:
z <- x[grep("IPv4", x)]
gsub(".*? ([[:digit:]])", "\\1", z)
"10.201.120.184" "10.201.120.157"
I recently created a minimal package using ipify.org to do this exact thing.
Usage is easy, you can install using devtools and github.
library(devtools)
install_github("gregce/ipify")
once installed, its as easy as loading the library and one function call...
library(ipify)
get_ip()
Though #andrie explained it in very layman language and i am sure it helped us a lot to understand the functionality of it.
So from there only sharing a one liner code without installing any other package.
gsub(".*? ([[:digit:]])", "\\1", system("ipconfig", intern=T)[grep("IPv4", system("ipconfig", intern = T))])
Hope this would be helpful!
This retrieves exactly what you want:
system('ipconfig getifaddr en0')
192.168.1.73

copy a line with specific pattern and paste it below in unix without opening a file

I have a specific requirement.
I have file:
some text
. . . . .
. . . . .
**todo: owner comments . . . .**
... .
sometext
Now I want the output like:
some text
. . . . .
. . . . .
**todo: owner comments . . . .**
**owner: todo comments . . . .**
... .
.
sometext
I want to grep for todo and copy that line and paste it below with above modification.
Can it be possible without opening a file... like sed,awk command ??
Thanks and Regards,
Dharak
I guess what you mean is opening the file in an editor. Here is an awk script you can tailor for your needs.
$ awk '/\*\*todo:/{print; print "**owner: todo ... ";next}1' file
some text
. . . . .
. . . . .
**todo: owner comments . . . .**
**owner: todo ...
... .
sometext
you can save the output to a temp file and move over to your original file.
sed 's/\(**todo: owner comments\)\(.*\)/\1 \2 \
> **owner: todo comments \2/g' filename
Patterns matched and replaced
New line is inserted manually by placing an enter after '\' at end of first line
'>' will come automatically pointing for the next characters to be inserted

Function for retrieving own ip address from within R?

Does anyone know of an R function that is able to retrieve one's own IP address (of the PC you're working on)? It would be very helpful! Many thanks in advance.
You can issue a system() command to your operating system:
In Windows you can use ipconfig
In Linux, use ifconfig
For example, on Windows try calling system() with the argument intern=TRUE to return the results to R:
x <- system("ipconfig", intern=TRUE)
This returns:
x
[1] ""
[2] "Windows IP Configuration"
[3] ""
[4] ""
[5] "Wireless LAN adapter Wireless Network Connection:"
[6] ""
[7] " Connection-specific DNS Suffix . : tbglondon.local"
[8] " Link-local IPv6 Address . . . . . : fe80::c0cb:e470:91c7:abb9%14"
[9] " IPv4 Address. . . . . . . . . . . : 10.201.120.184"
[10] " Subnet Mask . . . . . . . . . . . : 255.255.255.0"
[11] " Default Gateway . . . . . . . . . : 10.201.120.253"
[12] ""
[13] "Ethernet adapter Local Area Connection:"
[14] ""
[15] " Connection-specific DNS Suffix . : tbglondon.local"
[16] " Link-local IPv6 Address . . . . . : fe80::9d9b:c44c:fd4d:1c77%11"
[17] " IPv4 Address. . . . . . . . . . . : 10.201.120.157"
[18] " Subnet Mask . . . . . . . . . . . : 255.255.255.0"
[19] " Default Gateway . . . . . . . . . : 10.201.120.253"
[20] ""
[21] "Tunnel adapter Local Area Connection* 13:"
[22] ""
[23] " Media State . . . . . . . . . . . : Media disconnected"
[24] " Connection-specific DNS Suffix . : "
[25] ""
[26] "Tunnel adapter isatap.tbglondon.local:"
[27] ""
[28] " Media State . . . . . . . . . . . : Media disconnected"
[29] " Connection-specific DNS Suffix . : tbglondon.local"
[30] ""
[31] "Tunnel adapter Teredo Tunneling Pseudo-Interface:"
[32] ""
[33] " Media State . . . . . . . . . . . : Media disconnected"
[34] " Connection-specific DNS Suffix . : "
Now you can use grep to find the lines with IPv4:
x[grep("IPv4", x)]
[1] " IPv4 Address. . . . . . . . . . . : 10.201.120.184"
[2] " IPv4 Address. . . . . . . . . . . : 10.201.120.157"
And to extract just the ip address:
z <- x[grep("IPv4", x)]
gsub(".*? ([[:digit:]])", "\\1", z)
"10.201.120.184" "10.201.120.157"
I recently created a minimal package using ipify.org to do this exact thing.
Usage is easy, you can install using devtools and github.
library(devtools)
install_github("gregce/ipify")
once installed, its as easy as loading the library and one function call...
library(ipify)
get_ip()
Though #andrie explained it in very layman language and i am sure it helped us a lot to understand the functionality of it.
So from there only sharing a one liner code without installing any other package.
gsub(".*? ([[:digit:]])", "\\1", system("ipconfig", intern=T)[grep("IPv4", system("ipconfig", intern = T))])
Hope this would be helpful!
This retrieves exactly what you want:
system('ipconfig getifaddr en0')
192.168.1.73

How to I pass a list to cl-mustache?

I am trying to use CL-MUSTACHE. Rendering atomic variables works fine, following the examples in the README file:
> (mustache:mustache-render-to-string "{{year}}-{{month}}-{{day}}"
'((:year . "2012")
(:month . "07")
(:day . "02")))
"2012-07-02"
However, I am unable to figure out how to pass a list to render a section multiple times. The README file does not have an example, and the ways I have tried don't work. For example:
(mustache:mustache-render-to-string "{{#dates}}{{year}}-{{month}}-{{day}}
{{/dates}}"
'((:dates . (((:year . "2012")
(:month . "07")
(:day . "02"))
((:year . "2013")
(:month . "08")
(:day . "03"))))))
"--
"
I don't have it to check, but from the documentation, it seems that arrays are treated as CL arrays, so you can try this to see if it works:
(mustache:mustache-render-to-string "{{#dates}}{{year}}-{{month}}-{{day}}{{/dates}}"
'((:dates . #( ((:year . "2012")
(:month . "07")
(:day . "02"))
((:year . "2013")
(:month . "08")
(:day . "03"))))))
(that is, an array of lists of parameters).

Resources