Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Adjust cell sample app #100

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions Source/Cellular/Cell_Basics/cell.config.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions Source/Cellular/Cell_Basics/meadow.config.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Core\Source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="meadow.config.yaml">
Expand All @@ -15,5 +15,8 @@
<None Update="cell.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="app.config.yaml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Cell_Basics
{
public class MeadowApp : App<F7FeatherV2>
public class MeadowApp : App<F7CoreComputeV2>
{
public override Task Run()
{
Expand All @@ -32,11 +32,8 @@ public override Task Run()

void FetchSignalQuality(ICellNetworkAdapter cell)
{
double csq = cell.GetSignalQuality();
Console.WriteLine("Current Cell Signal Quality: " + csq);

double dbm = csq * 2 - 113;
Console.WriteLine("Current Cell Signal Quality (dbm): " + dbm);
int csq = cell.GetSignalQuality();
Console.WriteLine("Current Cell Signal Quality (dbm): " + csq);
}

// Useful method for troubleshooting by inspecting cellular connection logs
Expand Down Expand Up @@ -73,7 +70,7 @@ async void CellAdapter_NetworkConnected(INetworkAdapter networkAdapter, NetworkC
var cell = networkAdapter as ICellNetworkAdapter;
if (cell != null)
{
Console.WriteLine("Cell CSQ at the time of connection: " + cell.Csq);
Console.WriteLine("Cell CSQ at the time of connection (dbm): " + cell.Csq);
Console.WriteLine("Cell IMEI: " + cell.Imei);
await GetWebPageViaHttpClient("https://postman-echo.com/get?fool=bar1&foo2=bar2");
}
Expand All @@ -92,7 +89,7 @@ async Task GetWebPageViaHttpClient(string uri)

using (HttpClient client = new HttpClient())
{
// In weak signal connections and large download scenarios, it's recommended to increase the client timeout
// In weak signal connections and/or large download scenarios, it's recommended to increase the client timeout
client.Timeout = TimeSpan.FromMinutes(5);
using (HttpResponseMessage response = await client.GetAsync(uri, HttpCompletionOption.ResponseHeadersRead))
{
Expand Down
12 changes: 12 additions & 0 deletions Source/Network/Cell_Basics/app.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Uncomment additional options as needed.
# To learn more about these config options, including custom application configuration settings, check out the Application Settings Configuration documentation.
# http://developer.wildernesslabs.co/Meadow/Meadow.OS/Configuration/Application_Settings_Configuration/

# Logging configuration.
Logging:

# Adjust the level of logging detail.
LogLevel:

# Trace, Debug, Information, Warning, or Error
Default: Trace
28 changes: 28 additions & 0 deletions Source/Network/Cell_Basics/cell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Settings:
APN: YOUR-APN # (required) Access Point Name
Module: BG95M3 # (required) Module model (BG770A, BG95M3 or M95)
User: USER # (optional) APN user
Password: PASSWORD # (optional) APN password
Operator: 00000 # (optional) Carrier numeric operator code
Mode: CATM1 # (optional) Network mode (CATM1, NBIOT or GSM)
Interface: COM1 # (required) Serial interface (COM1 (default), COM4 or COM6)
EnablePin: A3 # (required) Enable MCU pin to turn the module on/off.
# Default value is MCU Pin A3

# IMPORTANT:
# Ensure to use the MCU pin names, not the Meadow pin names (seen on the board)
#
# Examples:
# Using mikroBUS 1 on Project Lab v3 with Quectel BG95-M3 (Meadow AN pin as enable pin):
# EnablePin: A3
#
# Using mikroBUS 1 on Project Lab v3 with Quectel M95 (Meadow RST pin as enable pin):
# EnablePin: H10
#
# Using Meadow D10 pin as Enable pin on F7FeatherV2 with BG95-M3 or M95:
# EnablePin: C7
#
# For a custom setup, consult the pinout definition on your
# Meadow device datasheet for the correct MCU pin names


33 changes: 33 additions & 0 deletions Source/Network/Cell_Basics/meadow.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Device specific config.
Device:
# Name of the device on the network.
Name: CellBasics

# Corresponding MCU pin names for the reserved pins
# (COMX_RX pin, COM_TX pin, ENABLE pin)
# Examples:
# Using mikroBUS 1 on Project Lab v3 with Quectel BG95-M3 (Meadow AN pin as enable pin),
# reserve the following:
ReservedPins: B15;B14;A3

# Using mikroBUS 1 on Project Lab v3 with Quectel M95 (Meadow RST pin as enable pin),
# reserve the following:
# ReservedPins: B15;B14;H10

# Using COM4 on F7FeatherV2 with BG95-M3 or M95 (Meadow D10 pin as enable pin),
# reserve the following:
# ReservedPins: I9;H13;C7

# Using COM1 on F7FeatherV2 with BG95-M3 or M95 (Meadow D10 pin as enable pin),
# reserve the following:
# ReservedPins: B15;B14;C7

# IMPORTANT:
# Ensure to use the MCU pin names, not the Meadow pin names (seen on the board)
# For a custom setup, consult the pinout definition on your
# Meadow device datasheet for the correct MCU pin names

# Network configuration.
Network:
# Which interface should be used?
DefaultInterface: Cell
Loading