Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Development
  3. MySensors WiFi Gateway with Arduino UNO and CC3000

MySensors WiFi Gateway with Arduino UNO and CC3000

Scheduled Pinned Locked Moved Development
11 Posts 3 Posters 3.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    flopp
    wrote on last edited by
    #2

    Found a topic here http://forum.mysensors.org/topic/375/arduino-cc3000-wifi-nrf24l01-over-spi, but that is not solved yet

    barduinoB 2 Replies Last reply
    0
    • F flopp

      Found a topic here http://forum.mysensors.org/topic/375/arduino-cc3000-wifi-nrf24l01-over-spi, but that is not solved yet

      barduinoB Offline
      barduinoB Offline
      barduino
      wrote on last edited by barduino
      #3

      Hi @flopp

      I've tried my CC3000 shield again with no luck, it just does not initialize.

      However at the time I got another board with just the CC3000 and it does work, I was able to connect it to my Wifi and ping a server.

      Also did some investigation on what it would take to have this module working with MySensors on 1.6

      This would imply changes on the core libraries, something I don't feel comfortable without support from the MySensors folks.

      But let me explain my rationale:

      We should be able to create a CC3000 gateway similar to WL5100 or even ESP8266 and from there we could go to the MQTT client.

      At the core we have the ethernet transport library:
      Here is a snippet:

      #if defined(MY_GATEWAY_ESP8266)
      	// Some re-defines to make code more readable below
      	#define EthernetServer WiFiServer
      	#define EthernetClient WiFiClient
      	#define EthernetUDP WiFiUDP
      
      	#if defined(MY_IP_ADDRESS)
      		IPAddress gateway(MY_IP_GATEWAY_ADDRESS);
      		IPAddress subnet(MY_IP_SUBNET_ADDRESS);
      	#endif
      	static bool clientsConnected[MY_GATEWAY_MAX_CLIENTS];
      

      It should be possible to so something like:

      #if defined(MY_GATEWAY_CC3000)
      	// Some re-defines to make code more readable below
      	#define EthernetServer Adafruit_CC3000_Server
      	#define EthernetClient Adafruit_CC3000_Client
      	//#define EthernetUDP WiFiUDP
      
      	#if defined(MY_IP_ADDRESS)
      		IPAddress gateway(MY_IP_GATEWAY_ADDRESS);
      		IPAddress subnet(MY_IP_SUBNET_ADDRESS);
      	#endif
      	static bool clientsConnected[MY_GATEWAY_MAX_CLIENTS];
      

      Of course we would need to port whatever methods are called from those EthernetClient/Server to the Adafruit_CC3000_Client/Server.

      However later in the code we have a "mysterious" WiFi object that I just cant find where is it coming from...

      bool gatewayTransportInit() {
      	_w5100_spi_en(true);
      	#if defined(MY_GATEWAY_ESP8266)
      		(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
      		#ifdef MY_IP_ADDRESS
      			WiFi.config(_ethernetGatewayIP, gateway, subnet);
      		#endif
      		while (WiFi.status() != WL_CONNECTED)
      		{
      			delay(500);
      			MY_SERIALDEVICE.print(".");
      			yield();
      		}
      		MY_SERIALDEVICE.print(F("IP: "));
      		MY_SERIALDEVICE.println(WiFi.localIP());
      

      I suppose this would be inside the ESP8266.h or similar.
      I do have the Adafruit_CC3000 library and for this to work we have to declare and instantiate a CC3000 object, something like

      Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,
                                               SPI_CLOCK_DIV2); // you can change this clock speed but DI
      

      And the we could call

      cc3000.begin()
      ...
      cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)
      ...
      etc
      

      But where to do this?

      On a lib under drivers, included when we define a MY_GATEWAY_CC3000 like the NRF drivers?

      #if defined(MY_RADIO_NRF24)
      		#if defined(MY_RF24_ENABLE_ENCRYPTION)
      			#include "drivers/AES/AES.cpp"
      		#endif
      		#include "drivers/RF24/RF24.cpp"
      		#include "core/MyTransportNRF24.cpp"
      

      Or maybe a MyHwCC3000 ?

      Perhaps @hek and the other folks can point us in the right direction

      Cheers

      1 Reply Last reply
      0
      • F flopp

        Found a topic here http://forum.mysensors.org/topic/375/arduino-cc3000-wifi-nrf24l01-over-spi, but that is not solved yet

        barduinoB Offline
        barduinoB Offline
        barduino
        wrote on last edited by
        #4

        @flopp

        If you're not using 1.6 i think @Connor-Rigby has what you need

        Check this out http://forum.mysensors.org/topic/2727/adafruit-cc33000-wifigateway

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Connor Rigby
          wrote on last edited by
          #5

          If you are using the shield version it might be difficult. You need to change the pin locations for CE and cs on the radio. You can do this in either myconfig.h or in your gateway code. It shouldn't need any code modification in the core libraries but do note it won't fit onto am UNO.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            flopp
            wrote on last edited by
            #6

            I got it to work, yeah.

            Thanks to @Connor-Rigby and @barduino

            I am using a Ardino MEGA 2560 and a LinkSprite CC3000 Shield wo SD-card with Adafruit CC3000 Library.

            I am using the code as Connor -Rigby linked to in his topic http://forum.mysensors.org/topic/2727/adafruit-cc33000-wifigateway

            I had to do some modifications

            1. I had to add, since LinkSprite CC3000 seems not sharing MOSI/MISO/SCK
            #include <DigitalIO.h>     // This include can be removed when using UIPEthernet module
            
            1. enabled SOFTSPI by removing // at #define SOFTSPI, in MyConfig.h, since LinkSprite CC3000 seems not sharing MOSI/MISO/SCK
            2. change SOFTSPI pins, since a MEGA doesn't use same pins as UNO.
            const uint8_t SOFT_SPI_MISO_PIN = 56;
            const uint8_t SOFT_SPI_MOSI_PIN = 55;
            const uint8_t SOFT_SPI_SCK_PIN = 54;
            
            1. Changed VBAT to 5 instead of 4, according to https://learn.adafruit.com/adafruit-cc3000-wifi/connections. Tested with 4 but not working.
            #define ADAFRUIT_CC3000_VBAT  5
            

            This is same pin as Radio_CE(see code) but it is working, i think because we never sleep NRF

            #define RADIO_CE_PIN        5  // radio chip enable
            

            So now I will run it and see if it works for a long period

            1 Reply Last reply
            0
            • F Offline
              F Offline
              flopp
              wrote on last edited by flopp
              #7

              It has been running now for 3 days but today Domoticz failed to communicate with it.
              I restarted gateway, let's see for how long it will work this time.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                flopp
                wrote on last edited by flopp
                #8

                Stopped after just 1,5 hours.

                This time I tried to only restart Domoticz, didn't help so I power-off power-on gateway and it start to work.

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  flopp
                  wrote on last edited by
                  #9

                  Stopped again.
                  I will stop using/testing this setup right now.
                  I will start to use UNO with W5100.

                  barduinoB 1 Reply Last reply
                  0
                  • F flopp

                    Stopped again.
                    I will stop using/testing this setup right now.
                    I will start to use UNO with W5100.

                    barduinoB Offline
                    barduinoB Offline
                    barduino
                    wrote on last edited by
                    #10

                    Hi @flopp

                    I think cc3000 disconnects from the Wifi and as @Connor-Rigby mentioned in his post there is some work to be done on that area.

                    C 1 Reply Last reply
                    0
                    • barduinoB barduino

                      Hi @flopp

                      I think cc3000 disconnects from the Wifi and as @Connor-Rigby mentioned in his post there is some work to be done on that area.

                      C Offline
                      C Offline
                      Connor Rigby
                      wrote on last edited by
                      #11

                      @barduino @flopp sorry guys i fixed this last week but forgot to tell anyone. it shou;d be on my github

                      1 Reply Last reply
                      1
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      13

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular