Need help serial

i hope i can but the school is not giving me a working internet which spark could connect to... so i using a router only = local wifi no net T.T
if i have the cloud it would be much easier

and thx for the reword i think i understand abit more

1 Like

I you've got the possibility to adapt your C# program, I'd go for that.

Molding the UDP/TCP stuff into your program isn't that hard and it saves you a lot of hassle with finding/setting up/running and communicating over a bridge.


BTW: What do you mean with

Can you connect any other devices to the net?

the spark core will not connect to my school network or my phone network

hmm i thought using the tcp-serial is like translating tcp into serial?

For one this doesn't tell me anything about why or how it doesn't, and it doesn't tell if you can connect any other devices to the school network.

As for your phone network, I guess you tried to WiFi tether the Core - this should work, unless you do it wrong.

As outlined above for the Serial-TCP-bridge you need a "translator" (software), which you haven't got - haven't set up - are not running - will have some troubles with, since you are obviously lacking the basics

Maybe you need someone at hand (physically) who might fill these gaps together with you, but not for you - as @bko has already suggested too.

it's something about the dhcp that cause it.
yeah i dled some serial-tcp solfware testing it out soon

so in my case am i to use serial-tcp or tcp-serial or both?

what do i put in this if i want my local pc as server and my spark as client

byte server[] = { 74, 125, 224, 72 }; <--- got from the doc it says google



TCPClient client;
// EXAMPLE USAGE

TCPClient client;
byte server[] = { 74, 125, 224, 72 }; // Google
void setup()
{
  // Make sure your Serial Terminal app is closed before powering your Core
  Serial.begin(9600);
  // Now open your Serial Terminal, and hit any key to continue!
  while(!Serial.available()) SPARK_WLAN_Loop();

  Serial.println("connecting...");

  if (client.connect(server, 80))
  {
    Serial.println("connected");
    client.println("GET /search?q=unicorn HTTP/1.0");
    client.println("Host: www.google.com");
    client.println("Content-Length: 0");
    client.println();
  }
  else
  {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available())
  {
    char c = client.read();
    Serial.print(c);
  }

  if (!client.connected())
  {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;);
  }
}

ok nvm i think i know how to use it
i need to test it out first

should i be using udp or tcp for local area network

i was reading some udp post and saw that there are afew problems with it, are they fix or the problems still there

@Jeffery, the UDP issues are due to the CC3000 implementation. UDP can still be used but you will need to parse the packets from the return response since the CC3000 does not. To that end, TCP may be a better choice though you will need to be aware that each time you use a client.write() or client.print(), a packet is sent. Accumulating a buffer of data and sending it at once using client.write(data, numbytes) will only send a single packet.

iā€™m using a wireless lan network
it does not connect to the internet
and what i need it to do is only to sent some int to a serial port, i am using a UDP-serial