mrossen Active Member Licensed User Longtime User Apr 6, 2020 #1 Hi, I use this way to send serial data in both b4i and b4a B4X: buffer = sData.GetBytes("ISO-8859-1") TcpStreams.Write(buffer) In b4a this works without problems, but in b4i when i send some type of string it seems like iOS not are sending it. My recieve code are not recieving anything I am not sure what the problem in the string can be, but if I change the encoding to UTF8 iOS send the string but in my recieve code it makes at crc error. Anyone knows if there i a difference in the way sending serial data on iOS and android Mogens
Hi, I use this way to send serial data in both b4i and b4a B4X: buffer = sData.GetBytes("ISO-8859-1") TcpStreams.Write(buffer) In b4a this works without problems, but in b4i when i send some type of string it seems like iOS not are sending it. My recieve code are not recieving anything I am not sure what the problem in the string can be, but if I change the encoding to UTF8 iOS send the string but in my recieve code it makes at crc error. Anyone knows if there i a difference in the way sending serial data on iOS and android Mogens
Erel B4X founder Staff member Licensed User Longtime User Apr 6, 2020 #2 Where does the data come from? Is it a string encoded with that encoding? Upvote 0
mrossen Active Member Licensed User Longtime User Apr 6, 2020 #3 If I open the file I read the data from, Notepad show the encoding as UTF8 I read the file like this: B4X: If File.Exists(File.DirDocuments, fPath) Then lstvar = File.Readlist(File.DirDocuments, fPath) Else Log("File not exist") Return End If Upvote 0
If I open the file I read the data from, Notepad show the encoding as UTF8 I read the file like this: B4X: If File.Exists(File.DirDocuments, fPath) Then lstvar = File.Readlist(File.DirDocuments, fPath) Else Log("File not exist") Return End If
Erel B4X founder Staff member Licensed User Longtime User Apr 7, 2020 #4 Is TcpStreams an AsyncStreams object? Where are you sending the data to? I don't think that encoding has anything to do with this. Upvote 0
Is TcpStreams an AsyncStreams object? Where are you sending the data to? I don't think that encoding has anything to do with this.
mrossen Active Member Licensed User Longtime User Apr 7, 2020 #5 Yes. I am sending the data to a esp8266 there is working as at wifi to serial bridge. This works perfect in b4a and b4j. And it is also working in b4i, but a few files out of approx 900 config files we are using It is not working. I send the 401 char to the buffer as in post #1, but nothing comes out of the iPhone/iPad. Do I change the encoding to utf8 the iPhone/iPad are sending data but not rigtht. I receive a CRC error from the reciever. The files I read the data from is encoded in utf8 and is a basic windows ini file structure. I have attached a sample file. B4X: TcpStreams.Initialize(WiFi_Socket.InputStream, WiFi_Socket.OutputStream, "TcpStreams") B4X: Dim ServerIp As String = "192.168.4.1" 'Access point IP Dim Port As Int = 8880 'Set til port 8880 WiFi_Socket.Initialize("WiFi_Socket") WiFi_Socket.Connect(ServerIp,Port,5000) Attachments 1530020 Toyota Yaris 1.4 D4-D TMMF Produktion 02-2003-.txt 1530020 Toyota Yaris 1.4 D4-D TMMF Produktion 02-2003-.txt 287 bytes · Views: 484 Upvote 0
Yes. I am sending the data to a esp8266 there is working as at wifi to serial bridge. This works perfect in b4a and b4j. And it is also working in b4i, but a few files out of approx 900 config files we are using It is not working. I send the 401 char to the buffer as in post #1, but nothing comes out of the iPhone/iPad. Do I change the encoding to utf8 the iPhone/iPad are sending data but not rigtht. I receive a CRC error from the reciever. The files I read the data from is encoded in utf8 and is a basic windows ini file structure. I have attached a sample file. B4X: TcpStreams.Initialize(WiFi_Socket.InputStream, WiFi_Socket.OutputStream, "TcpStreams") B4X: Dim ServerIp As String = "192.168.4.1" 'Access point IP Dim Port As Int = 8880 'Set til port 8880 WiFi_Socket.Initialize("WiFi_Socket") WiFi_Socket.Connect(ServerIp,Port,5000)
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2020 #6 Are you checking the data length on the receiving side? Don't assume that it will arrive in a single packet. Upvote 0
Are you checking the data length on the receiving side? Don't assume that it will arrive in a single packet.
mrossen Active Member Licensed User Longtime User Apr 8, 2020 #7 I have tried to connect my pc com port to the wifi module. When I use one of the confile that fails nothing is recieved. When i use a working file the data comes. It seems like iOS dont send any data when I use a config file with problem. Upvote 0
I have tried to connect my pc com port to the wifi module. When I use one of the confile that fails nothing is recieved. When i use a working file the data comes. It seems like iOS dont send any data when I use a config file with problem.
Erel B4X founder Staff member Licensed User Longtime User Apr 8, 2020 #8 AsyncStreams just sends bytes. It doesn't know or care where the bytes come from. Add some log message or put breakpoints and find out what is send to AsyncStreams. A good place to start: https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/#content Upvote 0
AsyncStreams just sends bytes. It doesn't know or care where the bytes come from. Add some log message or put breakpoints and find out what is send to AsyncStreams. A good place to start: https://www.b4x.com/android/forum/threads/b4x-network-asyncstreams-b4xserializator.72149/#content