Main Site Documentation

Netduino 3 Wi-Fi with TinyCLR OS: I2cDevice .Configuraton BMP180 and Networking Sockets class


#1

GHI community: Thank you for taking on the Netduino boards in Visual Studio 2017 with TinyCLR OS firmware and support Libraries.
The addition of TinyCLR OS firmware (most recent v0.8.0) for Netduino 3 Wi-Fi boards has saved my base course material. General “Gpio” pin assignment has gone well. But, I am still struggling with I2c (temp sensor) specifically, I2cDevice.Configuration and Networking “Socket” class code transformation from previous working VS.NETMF build. Any help is much appreciated.
I am using legacy I2c code for BMP180 sensor and Networking. Trying to get the files “cleaned-up” for the STM32F4 build.

Can’t fild the workaround for I2cDevice.Configuration and Socket code. The platform is Netduino 3 Wi-Fi (TinyCLR app), and MSVS2017. Thank you in advance for your help.
Code I2c generating the error:
private I2cDevice.Configuration _slaveConfig = new I2cDevice.Configuration(BMP085_ADDRESS, 100);
error is: the name Configuration does not exist in the type I2cDevice
The instance _slaveConfig is referenced several times later in code:
I2CBus.GetInstance().ReadRegister(_slaveConfig, (byte)Registers.BMP085_REGISTER_CHIPID, whoami, TransactionTimeout);

Networking code “Sockets” generating the error:
private Socket webSocket = null;
/* Initialize the Socket Class */
webSocket = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
Error message:
The type of Namespace “Socket” could not be found. Are you missing a a using directive…
Name “SocketType”, AddressFamily, ProtocolType all generate error message.

I have usings added to program build:
using System
using System.Threading
using System.Text
using System.Diagnostics
using System.IO
using GHIElectronics.TinyCLR.Networking
using GHIElectronics.TinyCLR.Networking.SPWF04Sx
using GHIElectronics.TinyCLR.Devices
using GHIElectronics.TinyCLR.Devices.Gpio
using GHIElectronics.TinyCLR.Devices.I2c
using GHIElectronics.TinyCLR.Pins

I have References added to the soluton
GHIElectronics.TinyCLR.Devices
GHIElectronics.TinyCLR.Networking.SPWF04Sx
GHIElectronics.TinyCLR.Pins


#2

We haven’t tested I2C I believe, but we need your help so please provide any feedback you have there.

Networking is not in the current release yet. Contributions are also welcome. I think the original code is open source from netduino? If so, can it just be moved to the TinyCLR firmware?


#3

As for I2C, the API is quite a bit different from what it was in NETMF. There’s no longer a configuration object. The docs have a simple intro example that should get you going with I2C.


#4

thank you. I will work on this and share my progress.