I’m able to flash my Spark Core over the web-based IDE, use Tinker to toggle either pin from my mobile phone, and ping google from whitin the Spark Core, however any attempt to create a conenction using HttpClient or TCP libraries fail.
I’m now testing with a snippet from Here but it also fails with:
@alinanco@Hootie81 Some cores can catch a problem where they no longer can do DNS lookups. The TCPClient connect method can either accept a char * or a IPAddress. Any char * passed will result in a call to gethostbyname that fails once the core gets into this bad state. You should try creating the IPAddress as @Hootie81 recommends and pass that IPAddress to the TCPClient.connect call.
If you absolutely need DNS lookup capabilities then there is a library you can add to your application that you can use for DNS lookups and then pass the IPAddress to the TCP calls.
I have noticed not all Spark Cores have this problem. I have 5 cores and one has this problem.
Ive just been doing some testing and ill need some spark help to add some bits to the spark code… Maybe @Dave or @zachary could help us out… I’m not fluent enough with git to do pull requests yet…
This will help with debug of this reoccurring DNS issue
trying to keep it in line with the WiFi class… most of the guts of it was there already. I have added a few lines to get the current DNS IP from the core. I build local and it works on my core at the moment, and shows a good dnsIP, but im sure on some of these other DNS mysteries it may show 126.96.36.199 as that seems to be the ip alot of people get and i had it on one of my cores that has since passed away.
in spark_wiring_wifi.h line 48 i added:
and then in spark_wiring_wifi.cpp line 49 i added:
It would also be good to know if you are on a “slow” network. The TI CC3000 has a timeout around 1 second for DNS lookups which normally is fine (when I measure other hosts on my network, for instance, I get answers in around 100 to 150 ms (less than 0.15 second)).
@bko & @Hootie81 I’m willing to test this. I have a 1.5mb DSL internet connection. I have 8 cores, some I have not yet tested for this behavior. I use three constantly, one demonstrates the DNS problem, the other two don’t. The one that has the DNS problem did not alway have it. It worked when I first started using it but now it consistently fails to resolve DNS without the additional library. I have not built locally in months, between this and the I2C problem i might be motivated to getting the environment back up and running. In the mean time if you want to make .bin files available I can test on my failed core and working core.
In a few weeks we are hoping to release our software. For that product release we can’t depend on a local build as we will be releasing the application as Open Source and it will need to build in the IDE. So hopefully we find find a fix that could be pulled into the IDE.
They reference the problem is related to static IP address, but we are using DHCP and the problem exists. How can we check which TI firmware is running on the Core? The thread mentions that 1.11 works but 1.13 fails. Is there anyway I can check my batch of cores to see what firmware they are running?
@hootie81 The call to WiFi.clearCredentials appears to clear NVRAM (or at least what is being displayed as the DNS IP address in ip_config.aucDNSServer) however after setting the WiFi credentials and rebooting the DNS IP returns to 188.8.131.52
its the bit after the clearing nvmem, i think that should do it, clear_netapp_dhcp calls netapp_dhcp that sets the IP, subnet mask, gateway and the dns to 0. but like i said its over my head… i dont understand c++ let alone c
I did and it did not make any difference. I know it reset the WiFi credentials because the core went to blinking blue and I needed to set the WiFi credentials. But after doing that DNS IP still stuck on 184.108.40.206
So maybe I need to return the core to Spark and have it replaced.
@bko, thanks i just checked it and its at 1.28. I think this core is just not going to recover. I can’t really use it as it almost always gets the 220.127.116.11 DNS ip address. I’ve written an app that will turn off the WiFi, reset the settings, turn on the WiFi and test the DNS IP. It takes several attempts but eventually I can get the correct DNS IP setting. But it will never keep it after a power cycle.