Page 1 of 1

Need some help implementing a WiFi radio

Posted: Thu Dec 20, 2012 3:49 pm
by MasterFrmMO88
Hi all,

I am still pretty new to the hardware and software involved with the Netburner platform. I'm kind of learning as I go and I'm getting a decent understanding of how the netburner module itself works from a software standpoint and a little on the hardware side but I'm now to a point where I know I am going to need outside help.

I have an implementation that uses a 5270. It sets up a pretty basic TCP Client that receives single byte messages and translates those messages to GPIO commands. Depending on the byte received it may have to send an acknowledgement byte back to the server. There's also a DMA interrupt so it can execute multiple commands at a time, but for the purposes of this question: TCP Client that receives and sends single bytes.

Now I want to take this implementation and make it wireless. I'm a little leery about developing it with the current NB wireless card because of the question of availability and I'm hoping to have something ready by Feb-Mar so I'm trying to get the development work done now. So I started looking around and decided on a module developed by a newer company called Bluegiga, a WF121. Unfortunately, because they are a newer company they have a limited amount of documentation and their customer service so far leaves something to be desired.

I'm not sure if the documentation for this WF module is readily available or not. Near as I could tell I couldn't get much in the way of documentation until I signed up for an account on their website. If anyone would like to see any of the documentation I can attach them. I have a datasheet, a ref man for their BGScript language, and another ref man for equivalent C++ commands for their BGScript language.

The WF121 module has three interface types: I2C, SPI, and UART. The only way to connect the module directly to a computer out of the box to load firmware to it is using a USB/UART converter which I don't yet have access to because I don't have a PCB laid out for my implementation yet. The catch is I'm avoiding laying out a PCB because prototyping them is expensive and I don't want to order them until I have a final design planned.

Anyway, I'm mostly needing a step in the right direction. I think the best way to start out going about this is to go ahead and interface the WF121 with the NB Module and have the NB module start loading commands to the WF121 over whichever interface is most appropriate. My preference would be to have the WF121, on startup: determine an ip, connect to the given network, start a TCP client and simply send the received bytes to the NB when ready. Any combination between the NB and the WF is fine as long as it accomplishes the TCP Client task over a wireless network. But given that this is a third-party wireless card and my lack of knowledge when it comes to the interface programming, any help is greatly appreciated because some guidance will be a lot smoother than me stumbling around in the dark.

Re: Need some help implementing a WiFi radio

Posted: Thu Dec 20, 2012 5:07 pm
by Chris Ruff
If I were you I would connect the WF121 to the 5270 dev board with a uart connection and start sending and receiving simple commands to and from the WF121. After you have some experience doing things like getting network names and getting an open network (connect some wireless router to your LAN and turn off all security for awhile on it) talking to you- you will be able to build high level functions that do all of the low level operations for you.

You won't need to design the board until later- just use Netburner's dev board for everything, power, rs-232 level shifting (if necessary), etc.

Good luck- you will soon be the *Technology Leader* on the WF121

Chris

Re: Need some help implementing a WiFi radio

Posted: Sun Dec 30, 2012 9:19 am
by BillC
I cant help you with the WF121, but I have used some Roving Networks wifi modules with the netburner boards, the documentation makes it fairly easy to communicate with. Some of thier boards also have I/O and analog ports onboard.

http://www.rovingnetworks.com/

I hope this is helpful to you.

Bill

Re: Need some help implementing a WiFi radio

Posted: Fri Jan 25, 2013 7:53 pm
by MasterFrmMO88
This may be something I am overlooking but any help is appreciated.

We finally gave up on trying to get the WF121 to work. It's still a little too buggy so for now we are using the NB wifi card. I just got them in the mail yesterday and started working on it today. I was going to load the wifi_infrastructure example on my NetBurner but I can't get it to build. I am running into this error:

c:\installer\nburn\system/netDevice.cpp:415: undefined reference to `NetDeviceGetDeviceRtl8711SdioSpi(int, int, _NetDeviceSelectDetail)'

Oh and I am running NNDK 2.6

Update:

Tried rolling back to Eclipse 2.5.2 and still am getting the same error but with a slightly different file path.
I also tried including the netDevice.h file directly and that didn't help.

Re: Need some help implementing a WiFi radio

Posted: Sat Jan 26, 2013 7:02 pm
by tod
I don't use WiFi so I'm guessing, but since it's the weekend it may save you time until NB chimes in.
Sounds like a linker error to me. I can see the NetDeviceGetDeviceRtl8711SdioSpi() declared in the NetDevice.h and I can see that it's not defined in the corresponding .cpp file. That means it has to be somewhere else. A search of my entire nburn folder turns up nothing. That leads me to believe it's part of the WiFi development kit. In particular the NNDK used to have a library named rtl8711.a but that is no longer distributed with the NNDK. You probably get it or something similar with with WiFi development kit. If so you would need to put it in on your machine somewhere (typically the lib folder) then adjust your C++ settings to include the path to that lib file.

Re: Need some help implementing a WiFi radio

Posted: Mon Jan 28, 2013 9:01 am
by dciliske
Tod's spot on the money with where it's located. The missing rtl8711.a library was due to bug (/oversight/someone not including it) in a new buildscript. Send us a support request and we'll get it to you.

Re: Need some help implementing a WiFi radio

Posted: Mon Jan 28, 2013 10:51 am
by MasterFrmMO88
Already ahead of you. I sent in a support request yesterday and had a reply at 9:30 this morning. From someone named Forrest Stanley. He sent me the missing library file and gave me a quick how-to on adding it in the linker. Closed the linker window and it finished successfully building immediately.

Re: Need some help implementing a WiFi radio

Posted: Mon Oct 03, 2016 1:31 am
by Angela jordan
In the past few months, I’ve done a fair amount of BGScript work for my own projects, as well as for some of my clients. One feature that pops up occasionally is the need to generate a random number. In most programming languages, there is a built-in language-level (or standard library) feature which uses a seeded random number generator (or pseudo-random number generator) to generate a random integer. BGScript did not have this functionality – until now.

Note: The full sample code for this post is on my Github page, in my BLE113 examples repo (https://github.com/sureshjoshi/ble113-f ... -examples).

As per this Bluegiga forum post, you can generate a somewhat random number by using (effectively) noise from the LSBs of the internal temperature sensor. This method works, but what I noticed in practice is that the same numbers are repeated very often, like a bad version of the 80/20 rule (as a ballpark, let’s say we have 1 byte’s worth of random numbers, out of 255 possible values, I saw the same 30 numbers over 75% of the time).

I didn’t dig into this, but I assume it’s partially caused by the quantization levels of the ADC – but it really doesn’t matter.

My PRNG (that’s what people in the biz call pseudo-random number generators) research took me through a lot of random number generator algorithms, but this being BGScript and having all its performance and maintainability limitations – I decided easiest was best. You can read full post here: http://www.sureshjoshi.com/embedded/bgs ... generator/