Adafruit CC33000 WifiGateway
-
Hello i don't know if this has been done before but i just wanted to throw my project out there. It isnt commented very well and im sorry but most of it comes from the Ethernet Gateway code anyway so i think it is easy enough to figure out.
anyway here it is. Wiring is fairly simple, wire spi lines in paralles, then just follow the d#defines.
https://github.com/pressy4pie/wifigateway/tree/master
-
Also just a note it hits 98% of memory on an UNO. So any further revisions are almost garanteed to need a mega or similar.
-
@Connor-Rigby very interesting.
A good candidate to port to 1.6, if you're interested check this out http://forum.mysensors.org/topic/2709/mysensors-wifi-gateway-with-arduino-uno-and-cc3000
Thanks for sharing
-
I haven't updated to 1.6 yet but I'll try it out tomorrow. Right now it needs a bit of self healing stuff in the actual loop itself. I had to remove some of the original Ethernet gateway code that should be added back. This was more of proof of concept. It does work but after the connection drops for any reason its hard to get it running again without resetting both the controller and the gateway.
Edit: im using the development branch at mysensors now so if anyone wants to try it out, check here
-
Bump check the edit on the last post
-
Hey @Connor-Rigby
I will try it for sure.
But one question when I go to https://github.com/PressY4EKG/Arduino/blob/2177387fc4f388de02f60cd4698f62e4a200fefe/libraries/MySensors/core/MyHwCC3000.cpp
Its empty...
Does this mean you're using the CC3000 libraries directly?
-
Hey @Connor-Rigby
Here are my findings...
Compilation perfect, no issues.
The changes to the gateway example I used were just pin configurations:
#define MY_RF24_CE_PIN 9 #define MY_RF24_CS_PIN 10 #define MY_RF24_CHANNEL 111 ... #define MY_CC3000_CS 8 #define MY_CC3000_VBAT 5 #define MY_CC3000_IRQ 3
It starts up like this:
255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta) 0;255;3;0;9;Radio init successful. Starting WiFi CC3000 Started Connected Got IP 0;255;3;0;9;Init complete, id=0, parent=0, distance=0
All good.
I wanted to tell me what was my IP address so I've added these lines to the MyGatewayTransportEthernet.ccpMY_SERIALDEVICE.print(F("\nIP Addr: ")); cc3000.printIPdotsRev(ipAddress); MY_SERIALDEVICE.print(F("\nNetmask: ")); cc3000.printIPdotsRev(netmask); MY_SERIALDEVICE.print(F("\nGateway: ")); cc3000.printIPdotsRev(gateway); MY_SERIALDEVICE.print(F("\nDHCPsrv: ")); cc3000.printIPdotsRev(dhcpserv); MY_SERIALDEVICE.print(F("\nDNSserv: ")); cc3000.printIPdotsRev(dnsserv); MY_SERIALDEVICE.println();
But the results were not what I expected
255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta) 0;255;3;0;9;Radio init successful. Starting WiFi CC3000 Started Connected Got IP IP Addr: 8.0.0.1 Netmask: 0.255.252.225 Gateway: 168.1.6.0 DHCPsrv: 0.0.168.168 DNSserv: 225.252.255.115 0;255;3;0;9;Init complete, id=0, parent=0, distance=0
Strange...
Any way I've fixed the ip address on my router
and can ping it from a terminal
RVB:~ rvb$ ping 10.0.0.7 PING 10.0.0.7 (10.0.0.7): 56 data bytes 64 bytes from 10.0.0.7: icmp_seq=0 ttl=64 time=4.674 ms 64 bytes from 10.0.0.7: icmp_seq=1 ttl=64 time=19.361 ms 64 bytes from 10.0.0.7: icmp_seq=2 ttl=64 time=4.335 ms 64 bytes from 10.0.0.7: icmp_seq=3 ttl=64 time=9.256 ms 64 bytes from 10.0.0.7: icmp_seq=4 ttl=64 time=7.163 ms 64 bytes from 10.0.0.7: icmp_seq=5 ttl=64 time=10.054 ms 64 bytes from 10.0.0.7: icmp_seq=6 ttl=64 time=24.724 ms 64 bytes from 10.0.0.7: icmp_seq=7 ttl=64 time=4.882 ms ^C --- 10.0.0.7 ping statistics --- 8 packets transmitted, 8 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 4.335/10.556/24.724/7.046 ms
I'm also able to send commands via MYSController
0;255;3;0;9;Eth: connect 0;255;3;0;9;Eth: 0;0;1;0;0;123 0;255;3;0;9;Eth: 0;0;1;0;0;456 0;255;3;0;9;Eth: 0;0;1;0;0;789
So Kudos Mr. @Connor-Rigby you did it, excellent work!!
And since we love pictures...
Cheers
-
@barduino said:
Hey @Connor-Rigby
I will try it for sure.
But one question when I go to https://github.com/PressY4EKG/Arduino/blob/2177387fc4f388de02f60cd4698f62e4a200fefe/libraries/MySensors/core/MyHwCC3000.cpp
Its empty...
Does this mean you're using the CC3000 libraries directly?
Yeah it is. i was going to dump the code into that file and header but i decided to just usee the library.
@barduino said:
Hey @Connor-Rigby
Here are my findings...
Compilation perfect, no issues.
The changes to the gateway example I used were just pin configurations:
#define MY_RF24_CE_PIN 9 #define MY_RF24_CS_PIN 10 #define MY_RF24_CHANNEL 111 ... #define MY_CC3000_CS 8 #define MY_CC3000_VBAT 5 #define MY_CC3000_IRQ 3
It starts up like this:
255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta) 0;255;3;0;9;Radio init successful. Starting WiFi CC3000 Started Connected Got IP 0;255;3;0;9;Init complete, id=0, parent=0, distance=0
All good.
I wanted to tell me what was my IP address so I've added these lines to the MyGatewayTransportEthernet.ccpMY_SERIALDEVICE.print(F("\nIP Addr: ")); cc3000.printIPdotsRev(ipAddress); MY_SERIALDEVICE.print(F("\nNetmask: ")); cc3000.printIPdotsRev(netmask); MY_SERIALDEVICE.print(F("\nGateway: ")); cc3000.printIPdotsRev(gateway); MY_SERIALDEVICE.print(F("\nDHCPsrv: ")); cc3000.printIPdotsRev(dhcpserv); MY_SERIALDEVICE.print(F("\nDNSserv: ")); cc3000.printIPdotsRev(dnsserv); MY_SERIALDEVICE.println();
But the results were not what I expected
255;3;0;9;Starting gateway (RNNGA-, 2.0.0-beta) 0;255;3;0;9;Radio init successful. Starting WiFi CC3000 Started Connected Got IP IP Addr: 8.0.0.1 Netmask: 0.255.252.225 Gateway: 168.1.6.0 DHCPsrv: 0.0.168.168 DNSserv: 225.252.255.115 0;255;3;0;9;Init complete, id=0, parent=0, distance=0
Strange...
Any way I've fixed the ip address on my router
and can ping it from a terminal
RVB:~ rvb$ ping 10.0.0.7 PING 10.0.0.7 (10.0.0.7): 56 data bytes 64 bytes from 10.0.0.7: icmp_seq=0 ttl=64 time=4.674 ms 64 bytes from 10.0.0.7: icmp_seq=1 ttl=64 time=19.361 ms 64 bytes from 10.0.0.7: icmp_seq=2 ttl=64 time=4.335 ms 64 bytes from 10.0.0.7: icmp_seq=3 ttl=64 time=9.256 ms 64 bytes from 10.0.0.7: icmp_seq=4 ttl=64 time=7.163 ms 64 bytes from 10.0.0.7: icmp_seq=5 ttl=64 time=10.054 ms 64 bytes from 10.0.0.7: icmp_seq=6 ttl=64 time=24.724 ms 64 bytes from 10.0.0.7: icmp_seq=7 ttl=64 time=4.882 ms ^C --- 10.0.0.7 ping statistics --- 8 packets transmitted, 8 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 4.335/10.556/24.724/7.046 ms
I'm also able to send commands via MYSController
0;255;3;0;9;Eth: connect 0;255;3;0;9;Eth: 0;0;1;0;0;123 0;255;3;0;9;Eth: 0;0;1;0;0;456 0;255;3;0;9;Eth: 0;0;1;0;0;789
So Kudos Mr. @Connor-Rigby you did it, excellent work!!
And since we love pictures...
Cheers
yeah the cc3000 handles all that information weird. on monday ill try to get that going. i decided i wasnt actually going to use this on my project anyway.
-
I can try to give it a shot.
My objective is the MQTTGateway but with what you've done so far I think I can try to tackle it.
It would be interesting to add this to the development branch I wonder what @hek and the MySensors folks think about that possibility
Thanks
-
@barduino
i made a pull request for the development branch but they want me to change a couple more things before they merge it. I just havent got around to it yet. Ive never messed with the mqtt gateway nor do i really even know what it is but let me know if i can help you out
Suggested Topics
-
Welcome
Announcements • • hek