# System

This section contains a API calls to enable/disable parts of Misty's system.

### EnableCameraService

Enables the camera service running on Misty's 820 processor.

{% hint style="success" %}
misty.enable\_camera\_service()
{% endhint %}

For more information about disabling and enabling the camera service, see the `DisableCameraService` command description.

### DisableCameraService

Disables the camera service running on Misty's 820 processor.

Disabling a specific service frees up memory on the 820 processor for other tasks, and can improve the performance of other services that use the same processor. As an example, you may consider disabling the audio and camera services before you start mapping or tracking within a map to improve the performance of Misty's simultaneous localization and mapping (SLAM) activities.

{% hint style="success" %}
misty.disable\_camera\_service()
{% endhint %}

### CameraServiceEnabled

Describes whether the camera service running on Misty's 820 processor is currently enabled.

{% hint style="success" %}
misty.camera\_service\_enabled()
{% endhint %}

### EnableAudioService

Enables the audio service running on Misty's 820 processor.

{% hint style="success" %}
misty.enable\_audio\_service()
{% endhint %}

### DisableAudioService

Disables Misty's audio service.

{% hint style="success" %}
misty.disable\_audio\_service()
{% endhint %}

### EnableAVStreamingService

Enables Misty's AV streaming service for other API calls in [Stream Assets](/python-elements/misty-python-api/stream-assets.md)

{% hint style="success" %}
misty.enable\_av\_streaming\_service()
{% endhint %}

### DisableAVStreamingService

Disables Misty's AV streaming service.

{% hint style="success" %}
misty.disable\_av\_streaming\_service()
{% endhint %}

### EnableSlamService (Misty II Pro)

Enables the SLAM service running on Misty's 820 processor.

{% hint style="success" %}
misty.enable\_slam\_service()
{% endhint %}

For more information about disabling and enabling the SLAM service, see the `DisableSlamService` command description.

### DisableSlamService

Disables Misty's Slam service.

{% hint style="success" %}
misty.disable\_slam\_service()
{% endhint %}

### GetAvailableWiFiNetworks

Obtains a list of local Wi-Fi networks and basic information regarding each.

{% hint style="success" %}

```python
misty.get_available_wifi_networks
```

{% endhint %}

### ConnectWiFi

Connects Misty to a new WiFi.

**Example Code**

{% hint style="success" %}

```python
misty.connect_to_saved_wifi("dlink-5256","home1234")
```

{% endhint %}

**Parameters**

```python
misty.connect_wi_fi(self, networkName : str = None, password : str = None)
```

* NetworkId (string) - The name of the network to connect to.
* Password (string) - The password for the network.

### ConnectToSavedWiFi

Connects Misty to a saved Wi-Fi network.

{% hint style="success" %}

```python
misty.connect_to_saved_wifi("tp-link1234")
```

{% endhint %}

**Parameters**

```python
misty.connect_to_saved_wifi(self, networkId : int = None)
```

* NetworkId (string) - The name of the network to connect to.

### ForgetWiFi

Deletes information about a Wi-Fi network from Misty's list of saved networks. If you send this command without any parameters, Misty deletes information for all of her saved networks.

**Example Code**

{% hint style="success" %}

```python
misty.connect_to_save_wifi("tp-link1234")
```

{% endhint %}

**Parameters**

```python
misty.forget_wifi(self, networkId : int = None)
```

* NetworkId (string) - The name of the network to connect to.

### StartWifiHotspot <a href="#startwifihotspot" id="startwifihotspot"></a>

Starts Misty II broadcasting its own wireless network.

This command lets you use Misty II as a soft access point, which is useful in environments with no local networks, or networks that Misty can't connect to (such as captive networks).

{% hint style="success" %}

```
misty.start_wifi_hotspot
```

{% endhint %}

Follow these steps to use Misty as a WiFi hotspot:

1. Boot up the robot.
2. Issue a `StartWifiHotspot` command.
3. Issue a `GetDeviceInformation` command to access the network ID and password for Misty's access point. In the `GetDeviceInformation` response data, the network ID is stored in the `currentProfileName` field, and the password is stored in the `currentPreSharedKey` field. Use these credentials to connect your computer or another WiFi enabled device to Misty's access point.
4. Use Misty's standard IP address - `192.168.43.1` - to connect to the robot and issue commands from your connected device.
5. When you are finished using Misty as an access point, issue a `StopWifiHotspot` command.

**Tip:** If you plan to use Misty as a hotspot in an environment where you are unable to connect to any wireless networks, you may consider writing a JavaScript or .NET skill that runs on startup to issue the commands that create the access point. You can code Misty to display the credentials for the access point on her screen, or even to speak them out loud. Otherwise you must find a way to issue the HTTP API commands to start broadcasting WiFi over a separate network connection.

### StopWifiHotspot <a href="#stopwifihotspot" id="stopwifihotspot"></a>

Stops Misty II broadcasting its own wireless network.

{% hint style="success" %}

```
misty.stop_wifi_hotspot
```

{% endhint %}

To enable Misty as a soft access point, follow the steps in the documentation for the [`StartWifiHotspot`](https://docs.mistyrobotics.com/misty-ii/web-api/api-reference/#startwifihotspot) command.

### &#x20;GetLogFile

Obtains log file data.

{% hint style="success" %}

```python
misty.get_log_file(2024/1/1)
```

{% endhint %}

If no date is specified, pulls up to 3MB of the most recent log data from log files up to 14 days old. Log data returns in ascending order by date and time. If all log data exceeds 3MB, the oldest entry returned may be truncated.

If a date is specified, pulls up to 3MB of log data from that date. If log data from that date exceeds 3MB, the oldest entry may be truncated.

**Parameters**

```python
misty.get_log_file(self, date : datetime = None)
```

* `Date` (string) - Optional. The date of the log file to obtain. Dates must be formatted as: `MonthName/Date/FourDigitYear` or `FourDigitYear/MonthNumber/Date`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lessons.mistyrobotics.com/python-elements/misty-python-api/system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
