iOS Question Encoding problem

mrossen

Active Member
Licensed User
Longtime User
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
 

mrossen

Active Member
Licensed User
Longtime User
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

mrossen

Active Member
Licensed User
Longtime User
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
    287 bytes · Views: 216
Upvote 0

mrossen

Active Member
Licensed User
Longtime User
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
Top