Question

Hi,

I have two problems regarding wifi

1-

I am trying to connect the pmod wifi to an arduino uno. I looked for a library, the best I could found is the WiShield https://github.com/airsoftsoldrecn9/WiShield . Clearly, this library is for the WiShield

 https://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=90_186&products_id=2165  

but I thought because they use the same wifi chip as the pmod wifi this could work. However, after I manage to compile the library (I attached the working library after some minor modification in order to for it to compile) and after I connected the pmod wifi to the SPI of the arduino uno nothing seems to work. I tried to debug and I noticed that the code stuck in initialization stage, specifically in the file g2100.cpp line 144 (do-while loop). Could any one be kind enough to help or, if there is a working library for pmod wifi, that would be great.

2-

I have the chipkit wi-fire rev C,I tried the example WifiTcpEchoServer which is working just fine. However, I need to make the kit act as TcpClient, so I tried the example WifiTCPEchoClient, however it does not work. The problem is that the kit does connect to the router, however, it does not connect to another tcp server on the PC. I tested to see if that is a problem with firewall, but it is not. I tired to debug and I noticed that the code stops at deIPcK.tcpConnect function. I appreciate any help. 

Thanks

WiShield3.zip

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @SufSam,

There are some libraries that do work with the Pmod WiFi, they are the same libraries that are used to make the WiFIRE board function. The catch here though is that the libraries are part of the Digilent Core so they won't compile for a non-Digilent board; I found the needed libraries separate from the Digilent Core, but when I attempted to compile the code for the Arduino Uno I received a lot more errors than I anticipated and am able to readily fix.

I will check out the WifiTCPEchoClient to see how that goes and will get back to you.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

Thank you @JColvin for your fast response, I will be waiting for you to get back with another message. In the meanwhile, it would be helpful if you have a detail documentation (datasheet) for  the SPI commands and configuration of the MRF24WG0MA. Because I could not find that even on microchip website.

 

Share this post


Link to post
Share on other sites
  • 0

Ok, so I managed to modify the DEIPcK library to compile on Arduino, attached you can find the modified library. The modifications assume you connect the HIB pin of the pmod to the arduino pin 3,the pmod interrupt to the Arduino pin 2, the RST of the wifi pmod to arduino pin 4 and the SPI to the default SPI. You can change configs by changing the Arduino-MRF24WG.h,SPIandINT.h,wf_spi_stub.cpp,and wf_eint_stub.cpp.  Because I only have mega, I could not test the library.  This is because the library does require a ram which exceeds the available on Arduino mega as seen below.

Quote

Sketch uses 77796 bytes (30%) of program storage space. Maximum is 253952 bytes.Global variables use 14600 bytes (178%) of dynamic memory, leaving -6408 bytes for local variables. Maximum is 8192 bytes.
Not enough memory; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing your footprint.
Error compiling for board Arduino/Genuino Mega or Mega 2560.

However this can be solved if the PROGMEM is used for some of the arrays, also with some optimization. I think this is doable because the WiShield library (see the first post) compiles and fits on Uno. I do not have the detailed datasheet with detailed commands of the MRF24WG0MA. If I have, I may trace and modify WiShield library so it work. Anyway, I have posted this so others would save some time and maybe could solve the rest of the problems. Ok, any help is most appreciated. Looking forward to hear some good news about a library that works on Arduino for the PMOD WIFI. 

The WifiTCPEchoClient  example on the Wi Fire still does not work, looking forward to hear about that as well.

Thanks 

DEIPcK.zip

Edited by SufSam

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now